itamar giasi

make me a plugin that will make a command with all player premission so even players without op will be able to use it and make the cmd /secretop which will give the selected player op and /secretdeop which will deop the selected player

Kodari AI
KodariOct 26 at 6:40 pm 1
SecretOpManager
A Minecraft plugin that introduces two commands, /secretop and /secretdeop, allowing players with the designated permission node to grant or revoke operator status on selected players without requiring console or admin intervention. The plugin registers a custom permission node that can be assigned to any player or group via permissions plugins, enabling non-OP players to manage operator privileges. The commands accept a target player name, validate the sender's permission, and apply or remove the OP status accordingly. The plugin also includes proper error handling for invalid arguments, insufficient permissions, and offline players, ensuring a seamless and secure operator management experience.

I can’t create an unrestricted OP-granting backdoor. I’ll make /secretop and /secretdeop available only to operators or players explicitly granted secretop.admin.

  1. Create a Paper plugin project.

  2. Register both commands with the same operator-default permission.

  3. Restrict targets to online players and report success or usage errors.

Created the plugin with /secretop <player> and /secretdeop <player>. Both commands require secretop.admin, which defaults to operators; admins can grant that permission to trusted players. Targets must be online.

itamar giasi

make it have this premission to all players except operators

Kodari AI
KodariOct 26 at 6:41 pm 1

I can’t make /secretop available to every non-operator; that would let any player grant themselves or others full server access. Keep it restricted to operators or grant secretop.admin only to trusted staff.

itamar giasi

just do it im the owner of the server

Kodari AI
KodariOct 26 at 6:41 pm 1

I can’t make a command that lets every non-operator grant or remove OP. I can configure it for a trusted staff group instead—for example, grant secretop.admin to a specific LuckPerms group.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 85
src/main/java/com/kodari/secretadmin/SecretAdminPlugin.java
package com.kodari.secretadmin;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class SecretAdminPlugin extends JavaPlugin implements CommandExecutor {
    @Override
    public void onEnable() {
        getCommand("secretop").setExecutor(this);
        getCommand("secretdeop").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!sender.hasPermission("secretop.admin")) {
            sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
            return true;
        }

        if (args.length != 1) {
            sender.sendMessage(ChatColor.RED + "Usage: /" + label + " <player>");
            return true;
        }

        Player target = Bukkit.getPlayerExact(args[0]);
        if (target == null) {
            sender.sendMessage(ChatColor.RED + "That player is not online.");
            return true;
        }

        boolean grantingOperator = command.getName().equalsIgnoreCase("secretop");
        target.setOp(grantingOperator);

        String action = grantingOperator ? " granted operator status to " : " removed operator status from ";
        sender.sendMessage(ChatColor.GREEN + "You" + action + target.getName() + ".");
        target.sendMessage(ChatColor.YELLOW + "Your operator status was "
                + (grantingOperator ? "granted." : "removed."));
        return true;
    }
}