operationragnarok
📎 1 file 2,613 chars
📄
pasted-code-1785746039861.txt
txt 171 lines
▶
Create a Paper 1.21.11 Minecraft plugin that adds two admin-only items:

- Banisher
- Restorer

Both items should use the appearance/model of a Nether Star (CustomModelData should be configurable for resource packs).

=========================
BANISHER
=========================

Display Name:
§4§lBanisher

Material:
Nether Star

Admin Only:
Yes

Permission:
totemcraft.banisher

Obtained with:
/banisher give 

Behavior:

When an admin RIGHT CLICKS a player with the Banisher:

1. Save the player's:
- Entire inventory
- Armor
- Offhand
- XP Level
- Total XP
- Active potion effects

2. Clear:
- Inventory
- Armor
- Offhand
- XP
- Potion effects

3. Apply a permanent "Banished" state.

While Banished the player cannot:

- Move
- Jump
- Sprint
- Attack
- Take or deal damage
- Break blocks
- Place blocks
- Use items
- Eat
- Drop items
- Pick up items
- Open inventories
- Use containers
- Interact with entities
- Use commands except:
  /msg
  /tell
  /r
  /help

The Banished state lasts forever until restored.

Store all backed-up inventory data so it survives server restarts.

Prevent banishing a player twice.

Display configurable messages, sounds and particles.

=========================
RESTORER
=========================

Display Name:
§a§lRestorer

Material:
Nether Star

Permission:
totemcraft.restorer

Obtained with:
/restorer give 

Behavior:

Right click a Banished player.

Restore:

- Inventory
- Armor
- Offhand
- XP
- Potion effects

Remove Banished state.

Delete stored backup afterwards.

If no backup exists:
Display configurable error message.

=========================
CONFIG
=========================

Everything configurable:

- Display names
- Lore
- Messages
- Sounds
- Particles
- Permissions
- CustomModelData
- Glow effect
- Cooldowns (optional)

=========================
DATA STORAGE
=========================

Store all backups inside plugin/playerdata/
using UUID files.

Players must remain Banished after server restart.

=========================
INVENTORY GUI
=========================

Add:

/banisher list

Shows every currently Banished player.

Clicking a player displays:

- UUID
- Date Banished
- Who Banished them
- Restore button

=========================
QUALITY
=========================

Use modern Paper API.

No deprecated methods.

Proper null checks.

Async file saving where appropriate.

Clean package structure.

No memory leaks.

Compatible with Paper 1.21.11.
Kodari AI
KodariAug 3 at 8:38 am 24
TotemCraft
TotemCraft is a Paper 1.21.11 administration plugin centered on two configurable Nether Star tools: Banisher permanently isolates a player while securely backing up inventory, equipment, experience, and potion effects, and Restorer returns that data when authorized. It persists banished states across restarts, supports configurable messages, sounds, particles, lore, model data, glow, permissions, and cooldowns, and includes a paginated administrator GUI with player details and restoration controls.

1 the Paper 1.21.11. Create Gradle project and plugin configuration. 2. Implement persistent player backups, banish/restore services, configurable items, and cooldown handling. 3. Add interaction restrictions, commands, and the paginated banished-player GUI. 4. Register all components and provide default configuration values.

TotemCraft is a Paper 1.21.11 administration plugin that provides configurable Nether Star Banisher and Restorer tools. Authorized staff can permanently banish players by securely backing up inventories, armor, offhand contents, experience, and potion effects, then restore them later. It persists backups by UUID across restarts, enforces the complete banished restriction set, supports configurable models, glow, messages, sounds, particles, permissions, and cooldowns, and includes a paginated GUI for reviewing and restoring banished players.

G

Created the initial TotemCraft Paper 1.21.11 project with:

  • Configurable Banisher and Restorer Nether Star items

  • Persistent UUID-based player backups

  • Banished-state restrictions and restart persistence

  • Admin commands with permissions and cooldown support

  • Banished-player list and restore GUI

  • Configurable messages, lore, model data, glow, sounds, and particles

  • Gradle build configuration and plugin metadata

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
15 1,493
src/main/java/com/kodari/totemcraft/TotemCraftPlugin.java
package com.kodari.totemcraft;

import com.kodari.totemcraft.command.AdminItemCommand;
import com.kodari.totemcraft.data.BackupStorage;
import com.kodari.totemcraft.service.BanisherService;
import com.kodari.totemcraft.service.ItemFactory;
import com.kodari.totemcraft.util.MessageUtil;
import com.kodari.totemcraft.listener.GameplayListener;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class TotemCraftPlugin extends JavaPlugin {
    private MessageUtil messageUtil;
    private ItemFactory itemFactory;
    private BanisherService banisherService;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.messageUtil = new MessageUtil(this);
        this.itemFactory = new ItemFactory(this, messageUtil);

        BackupStorage storage = new BackupStorage(this);
        storage.load();

        this.banisherService = new BanisherService(this, storage, itemFactory, messageUtil);

        Bukkit.getPluginManager().registerEvents(
                new GameplayListener(banisherService, itemFactory),
                this
        );

        AdminItemCommand command = new AdminItemCommand(this, banisherService, itemFactory, messageUtil);
        Objects.requireNonNull(getCommand("banisher")).setExecutor(command);
        Objects.requireNonNull(getCommand("banisher")).setTabCompleter(command);
        Objects.requireNonNull(getCommand("restorer")).setExecutor(command);
        Objects.requireNonNull(getCommand("restorer")).setTabCompleter(command);
    }

    public BanisherService getBanisherService() {
        return banisherService;
    }

    public MessageUtil getMessageUtil() {
        return messageUtil;
    }
}