carloscostagordon_26234

A watch that transforms the player into any other person online on the server, replicating their skin and username.

Kodari AI
KodariJun 28 at 12:00 am 2

I’ll create the MorphWatch plugin — a disguise watch that copies another player’s skin and username.

MorphWatch
A disguise watch plugin that transforms players into any online player by replicating their skin and username. Features include a right-click watch GUI for player selection, packet-based disguise system using ProtocolLib, automatic re-disguise on respawn/world-change, tab list name replication, and full admin commands for disguise management.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
9 686
src/main/java/com/morphwatch/MorphWatch.java
package com.morphwatch;

import com.morphwatch.command.MorphWatchCommand;
import com.morphwatch.gui.PlayerSelectorGUI;
import com.morphwatch.listener.WatchListener;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class MorphWatch extends JavaPlugin {

    private DisguiseManager disguiseManager;
    private PlayerSelectorGUI playerSelectorGUI;
    private FileConfiguration messages;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.messages = getConfig();

        this.disguiseManager = new DisguiseManager(this);
        this.playerSelectorGUI = new PlayerSelectorGUI(this);

        getServer().getPluginManager().registerEvents(new WatchListener(this), this);
        getCommand("morphwatch").setExecutor(new MorphWatchCommand(this));

        getLogger().info("MorphWatch enabled!");
    }

    @Override
    public void onDisable() {
        if (disguiseManager != null) {
            disguiseManager.removeAll();
        }
        getLogger().info("MorphWatch disabled!");
    }

    public String msg(String key) {
        return getConfig().getString("messages." + key, "&cMessage not found: " + key);
    }

    public void reload() {
        reloadConfig();
        this.messages = getConfig();
    }
}