G

make me a plugin that makes Matei_x (a player function like a normal player)

Kodari AI
KodariMar 24 at 4:01 pm 6,824 (v2)

I’ll create a plugin that ensures the player Matei_x functions as a normal player, removing any special privileges and monitoring their status.

NormalPlayerEnforcer
A lightweight plugin that ensures specific players (like Matei_x) function as normal players by removing operator status, clearing special permissions, and enforcing standard player behavior. Includes automatic privilege removal on join, configurable player list, and optional activity logging. Administrators can toggle enforcement and manage the player list through simple commands.

Plugin created! This ensures Matei_x functions as a normal player by removing OP status and special permissions on join. Use /normalplayer add/remove <player> to manage the target list.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 320
src/main/java/com/mateix/normalplayer/NormalPlayerEnforcer.java
package com.mateix.normalplayer;

import com.mateix.normalplayer.commands.NormalPlayerCommand;
import com.mateix.normalplayer.listeners.PlayerJoinListener;
import com.mateix.normalplayer.managers.ConfigManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class NormalPlayerEnforcer extends JavaPlugin {

    private ConfigManager configManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        configManager.loadConfig();

        registerListeners();
        registerCommands();

        getLogger().info("NormalPlayerEnforcer has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("NormalPlayerEnforcer has been disabled!");
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
    }

    private void registerCommands() {
        getCommand("normalplayer").setExecutor(new NormalPlayerCommand(this));
    }

    public void reload() {
        configManager.loadConfig();
    }
}