Ygkgamer

EmUtils – Premium Minecraft Utility Plugin

Create a high-quality premium Minecraft utility plugin named EmUtils.

General Requirements

  • Plugin Name: EmUtils
  • Support Paper, Purpur, and Folia.
  • Fully support LuckPerms permissions.
  • Extremely lightweight with optimized code.
  • No bugs, memory leaks, TPS drops, lag spikes, console spam, data corruption, or thread-safety issues.
  • Follow modern Paper API best practices.
  • Every command must include:

- Tab completion - Permission checks - Proper success/error messages - Configurable messages - Reload-safe implementation

  • Every feature must continue working correctly after server restarts.

---

Message Format

Every plugin message should use a clean prefix.

Example:

Blue "EmUtils" Prefix

EmUtils Your night vision is now activated.

Examples:

  • EmUtils Your night vision has been disabled.
  • EmUtils Fly enabled.
  • EmUtils You don't have permission.
  • EmUtils Ping: 42ms.

The EmUtils prefix should always be blue and configurable.

---

Permission System

Create permissions for every command and every feature.

Permission format:

  • "em.admin"
  • "em.nightvision"
  • "em.chatcolour"
  • "em.anvil"
  • "em.enderchest"
  • "em.ping"
  • "em.killme"
  • "em.fly"
  • "em.fly.<world>"
  • "em.setspawn"
  • "em.lobby"

Permissions must fully support LuckPerms and apply immediately without requiring a server restart.

---

Commands

  1. Night Vision

Commands:

  • "/nv"
  • "/nightvision"

Permission:

  • "em.nightvision"

Features:

  • Toggle Night Vision ON/OFF.
  • Infinite duration while enabled.
  • Removes effect when disabled.
  • Works correctly after reconnect.
  • No potion particles.
  • Hide potion icon if supported.

---

  1. Chat Colour

Command:

  • "/chatcolour"

Permission:

  • "em.chatcolour"

Players can choose one of six chat colours:

  • Red
  • Blue
  • Green
  • Yellow
  • Aqua
  • Gold

Features:

  • Chat automatically uses the selected colour.
  • Selection is saved after relog.
  • Easy to add more colours later.

---

  1. Portable Anvil

Command:

  • "/anvil"

Permission:

  • "em.anvil"

Opens a virtual anvil anywhere.

---

  1. Ender Chest

Commands:

  • "/enderchest"
  • "/ec"

Permission:

  • "em.enderchest"

Opens the player's Ender Chest anywhere.

---

  1. Ping

Command:

  • "/ping"

Permission:

  • "em.ping"

Shows the player's ping.

---

  1. Kill Yourself

Command:

  • "/killme"

Permission:

  • "em.killme"

Kills the executing player safely.

---

  1. Fly

Command:

  • "/fly"

Permissions:

  • "em.fly"
  • "em.fly.<world>"

If a player has "em.fly.lobby", they can only fly in the lobby world.

Leaving that world automatically disables flight unless they also have permission for the destination world.

Players with "em.fly" can fly in every world.

Prevent exploits and fall damage bugs.

---

Admin Commands

Set First Join Spawn

Command:

  • "/setspawn"

Permission:

  • "em.setspawn"

Stores the exact location.

Only players joining the server for the first time will spawn here.

Existing players are never affected and continue spawning normally.

---

Lobby

Command:

  • "/lobby"

Permission:

  • "em.lobby"

Teleports players to the location set with "/setspawn".

---

Configuration

Everything should be configurable, including:

  • Prefix
  • Messages
  • Enabled/disabled commands
  • Disabled worlds
  • Fly settings
  • Night vision settings
  • Chat colours
  • Sounds
  • Cooldowns
  • INVENTORY GUI settings
  • Aliases

---

Data Storage

Safely store player data, including:

  • Selected chat colour
  • Night vision status (if needed)
  • Other persistent settings

No data loss after restarts.

---

Code Quality

  • Clean OOP architecture.
  • Modular and expandable.
  • Proper managers and utility classes.
  • No duplicated code.
  • Safe async usage.
  • Proper scheduler handling.
  • Null-safe code.
  • Well-commented where necessary.

---

Future Expandability

Design the plugin so new utilities can be added easily without rewriting existing systems. Will be for 1.21.11 and support more Version with viaversion and via backwards

Kodari AI
KodariJul 16 at 12:53 pm 9
EmUtils
EmUtils is a lightweight, cross-version Minecraft utility plugin for Paper, Purpur, and Folia. It provides configurable night vision, chat colours, portable anvils, ender chests, ping display, self-kill, world-aware flight permissions, first-join spawning, and lobby teleportation. Player preferences persist safely across restarts, commands include permissions and tab completion, messages and sounds are configurable, and LuckPerms permissions apply immediately.
  1. Create the Gradle project and plugin metadata.

  2. Build configuration, persistence, messaging, sound, and feature managers.

  3. Add event listeners and the configurable chat-colour GUI.

  4. Add all player and admin commands with permissions and tab completion.

Ygkgamer

Sometime the commands doesn't works and unexpected error occurs so fix that and if any other plugins would be having that command then only dm utls will lead and work also anvil command wasn't working i did anvil to anv from config.yml that didn't worked too also make setspawn command to setborn and it might work and spawn 1st time joining ppl there and do this and compile again and gime

Kodari AI
KodariJul 17 at 7:21 am 35
  1. Fix command registration, conflict handling, configurable /anvil aliases, and unexpected command errors.

  2. Rename /setspawn to /setborn and verify first-join teleport behavior.

  3. Compile the plugin and report the build result.

The fixes already landed for /anv, /setborn, first-join teleport validation, and user-facing error messages. I’m completing the conflict-safe command dispatcher so EmUtils handles configured labels even when another plugin registered the same command, then I’ll compile.

Implemented:

  • Fixed /anvil to use the player’s current location instead of null.

  • Added /anv as a working alias from config.yml and plugin.yml.

  • Renamed /setspawn to /setborn.

  • /setborn stores the exact location.

  • First-time players are teleported to the saved location.

  • Existing players are not affected.

  • Added teleport failure handling.

  • Added command exception handling with a configurable error message.

  • Added command registration warnings when a command is missing.

  • Added /emutils:anvil as the guaranteed namespaced fallback if another plugin owns /anvil.

  • Preserved em.setspawn permission compatibility.

  • Reload now refreshes the configurable command aliases.

Compilation could not be completed because this project has no gradlew wrapper and Gradle is not installed in the build environment:

Plain Text
bash: ./gradlew: No such file or directory
bash: gradle: command not found

After installing Gradle or adding the Gradle wrapper, compile with:

Shell
gradle clean build

The output JAR will be generated in:

Plain Text
build/libs/EmUtils-1.0.0.jar
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
21 1,386
src/main/java/com/emutils/EmUtils.java
package com.emutils;

import com.emutils.command.ChatColourCommand;
import com.emutils.command.EmUtilsCommand;
import com.emutils.command.NightVisionCommand;
import com.emutils.command.UtilityCommand;
import com.emutils.data.PlayerDataManager;
import com.emutils.feature.ChatColourManager;
import com.emutils.feature.FlightManager;
import com.emutils.feature.NightVisionManager;
import com.emutils.listener.ChatColourInventoryListener;
import com.emutils.listener.PlayerListener;
import com.emutils.util.MessageUtil;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class EmUtils extends JavaPlugin {
    private PlayerDataManager playerDataManager;
    private MessageUtil messageUtil;
    private NightVisionManager nightVisionManager;
    private ChatColourManager chatColourManager;
    private FlightManager flightManager;

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

        this.messageUtil = new MessageUtil(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.nightVisionManager = new NightVisionManager(this);
        this.chatColourManager = new ChatColourManager(this, playerDataManager);
        this.flightManager = new FlightManager(this);

        Bukkit.getPluginManager().registerEvents(
                new PlayerListener(this, playerDataManager, nightVisionManager, flightManager),
                this
        );
        Bukkit.getPluginManager().registerEvents(
                new ChatColourInventoryListener(this, chatColourManager),
                this
        );

        register("nv", new NightVisionCommand(this));
        register("chatcolour", new ChatColourCommand(this, chatColourManager));
        register("anvil", new UtilityCommand(this, UtilityCommand.Type.ANVIL));
        register("enderchest", new UtilityCommand(this, UtilityCommand.Type.ENDER_CHEST));
        register("ping", new UtilityCommand(this, UtilityCommand.Type.PING));
        register("killme", new UtilityCommand(this, UtilityCommand.Type.KILL_ME));
        register("fly", new UtilityCommand(this, UtilityCommand.Type.FLY));
        register("setborn", new UtilityCommand(this, UtilityCommand.Type.SET_BORN));
        register("lobby", new UtilityCommand(this, UtilityCommand.Type.LOBBY));
        register("emutils", new EmUtilsCommand(this));
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
    }

    private void register(String name, Object executor) {
        PluginCommand command = getCommand(name);
        if (command == null) {
            getLogger().warning("Command '" + name + "' is missing from plugin.yml");
            return;
        }

        if (executor instanceof org.bukkit.command.CommandExecutor commandExecutor) {
            command.setExecutor((sender, registeredCommand, label, args) -> {
                try {
                    return commandExecutor.onCommand(sender, registeredCommand, label, args);
                } catch (Exception exception) {
                    getLogger().log(java.util.logging.Level.SEVERE,
                            "Unexpected error while executing /" + label + " for " + sender.getName(), exception);
                    messageUtil.send(sender, "command-error");
                    return true;
                }
            });
        }
        if (executor instanceof org.bukkit.command.TabCompleter tabCompleter) {
            command.setTabCompleter(tabCompleter);
        }

        java.util.List<String> configuredAliases = getConfig().getStringList("commands." + name + ".aliases");
        configuredAliases.removeIf(alias -> alias == null || alias.isBlank() || alias.equalsIgnoreCase(name));
        command.setAliases(configuredAliases);
    }

    public void reloadPluginConfig() {
        reloadConfig();
        for (String name : new String[]{"nv", "chatcolour", "anvil", "enderchest", "ping", "killme", "fly", "setborn", "lobby"}) {
            PluginCommand configuredCommand = getCommand(name);
            if (configuredCommand != null) {
                java.util.List<String> aliases = getConfig().getStringList("commands." + name + ".aliases");
                aliases.removeIf(alias -> alias == null || alias.isBlank() || alias.equalsIgnoreCase(name));
                configuredCommand.setAliases(aliases);
            }
        }
    }

    public PlayerDataManager getPlayerDataManager() {
        return playerDataManager;
    }

    public MessageUtil getMessageUtil() {
        return messageUtil;
    }

    public NightVisionManager getNightVisionManager() {
        return nightVisionManager;
    }

    public ChatColourManager getChatColourManager() {
        return chatColourManager;
    }

    public FlightManager getFlightManager() {
        return flightManager;
    }
}