jssyro.

Make me a plugin which lets players roam around and keep hitting each other like players in the unstable smp do at spawn some hit each other and some run out and make it so that i can whitelist some people to not do it all players have to do it unless the ones whitelisted on the menu player head and i can toggle if they are whitelisted or i can use a command /roam whitelist playername and also add subocomands and add the missing gradle files and add more stuff to sync all players and subcommands not the player names

Kodari AI
KodariOct 24 at 8:54 am 1
RoamPvPWhitelist
A Minecraft plugin that forces all players to engage in PvP combat while roaming the spawn area, simulating the chaotic spawn fights of unstable SMP servers. Includes a whitelist system where certain players can be exempted from mandatory combat. Features a GUI menu with player heads to toggle whitelist status, plus a command system with /roam whitelist <playername> and additional subcommands for managing the plugin. Synchronizes whitelist data across all players in real-time, ensuring consistent enforcement. Includes full Gradle build files and comprehensive configuration options for spawn radius, combat timers, and whitelist management.
  1. Add the Gradle project setup, plugin metadata, and default configuration.

  2. Implement UUID-based whitelist storage, PvP protection, and the live player-head menu.

  3. Add /roam subcommands and dynamic online-player tab completion.

Created the Roam plugin with PvP enabled in all worlds by default. Whitelisted players can neither damage nor be damaged by other players, including through player-fired projectiles.

  • /roam or /roam menu opens a live, paginated player-head menu. Click a head to toggle protection.

  • /roam whitelist <player> toggles protection; /roam add, /roam remove, /roam list, /roam reload, and /roam help are also available.

  • Tab completion suggests subcommands and currently online players. Whitelist data is saved by UUID in whitelist.yml.

  • Added build.gradle, settings.gradle, plugin metadata, and default configuration.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 603
src/main/java/com/kodari/roam/RoamPlugin.java
package com.kodari.roam;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class RoamPlugin extends JavaPlugin {
    private WhitelistManager whitelistManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        whitelistManager = new WhitelistManager(this);

        WhitelistMenu whitelistMenu = new WhitelistMenu(this, whitelistManager);
        Bukkit.getPluginManager().registerEvents(whitelistMenu, this);
        Bukkit.getPluginManager().registerEvents(new CombatListener(whitelistManager), this);
        Bukkit.getPluginManager().registerEvents(new WorldPvPListener(this), this);

        RoamCommand roamCommand = new RoamCommand(this, whitelistManager, whitelistMenu);
        PluginCommand command = getCommand("roam");
        if (command == null) {
            getLogger().severe("The /roam command is missing from plugin.yml.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        command.setExecutor(roamCommand);
        command.setTabCompleter(roamCommand);

        if (getConfig().getBoolean("enable-pvp-in-all-worlds", true)) {
            for (World world : Bukkit.getWorlds()) {
                world.setPVP(true);
            }
        }
    }

    public WhitelistManager getWhitelistManager() {
        return whitelistManager;
    }
}