goku_black0411

Make a Minecraft server plugin and in the plugin it adds 3 keys called OVERWORLD KEY , NETHER KEY, END KEY to obtain the key any operator player had to type in the chat /keygive [playername] [keyname] and if any player means operator or non operator player if had three keys then if they place the three keys in a row in the crafting table they get a enchanted paper and if they named the paper in anvil by their username or any player username then they get operator

Kodari AI
KodariMar 30 at 7:05 am 9,781 (v2)

I’ll create a plugin that adds three special keys that can be combined to craft an enchanted paper which grants operator permissions when renamed to a username.

OpKeySystem
A progression-based operator permission system where players must collect three special keys (Overworld Key, Nether Key, and End Key), craft them together in a crafting table to create an enchanted paper, and rename the paper to a username in an anvil to grant that player operator permissions. Operators can distribute keys using the /keygive command.

Plugin created successfully! Here’s what was implemented:

OpKeySystem - A progression-based operator permission system with three collectible keys.

Features:

  • Three unique keys (Overworld, Nether, End) with custom names, lore, and enchanted appearance

  • /keygive <player> <OVERWORLD|NETHER|END> command (operators only)

  • Crafting recipe: Place all 3 keys anywhere in a crafting table to create an enchanted “Operator Certificate”

  • Rename the certificate to any username in an anvil, and that player receives operator permissions

  • Sound effects and broadcast messages when OP is granted

  • Uses PersistentDataContainer for reliable item identification across server restarts

The plugin handles both online and offline usernames - if the renamed username isn’t online, the paper is still consumed but notifies the player.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 370
src/main/java/com/opkeysystem/OpKeyPlugin.java
package com.opkeysystem;

import com.opkeysystem.commands.KeyGiveCommand;
import com.opkeysystem.listeners.AnvilRenameListener;
import com.opkeysystem.listeners.KeyCraftListener;
import lombok.Getter;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;

public class OpKeyPlugin extends JavaPlugin {

    @Getter
    private NamespacedKey overworldKeyKey;
    @Getter
    private NamespacedKey netherKeyKey;
    @Getter
    private NamespacedKey endKeyKey;
    @Getter
    private NamespacedKey opPaperKey;

    @Override
    public void onEnable() {
        overworldKeyKey = new NamespacedKey(this, "overworld_key");
        netherKeyKey = new NamespacedKey(this, "nether_key");
        endKeyKey = new NamespacedKey(this, "end_key");
        opPaperKey = new NamespacedKey(this, "op_paper");

        getServer().getPluginManager().registerEvents(new KeyCraftListener(this), this);
        getServer().getPluginManager().registerEvents(new AnvilRenameListener(this), this);

        getCommand("keygive").setExecutor(new KeyGiveCommand(this));
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}