Libor Čech

create me a minecraft plugin that when i type a command it will summon manequin but when i right click gui will open and i can customize atributes and who he atacks but gui will open only in creative

Kodari AI
KodariOct 27 at 6:54 pm 2
MannequinCustomizer
A Minecraft plugin that summons an armor stand mannequin via command. Right-clicking the mannequin opens a GUI where players can customize its attributes and configure attack targets. The GUI is restricted to creative mode players only. Features include attribute editing, target selection, and interactive inventory interface with button-based controls for seamless customization.

I’ll build a Paper plugin that summons a combat-capable mannequin, saves its settings, and opens its editor only for players in Creative mode. The GUI will adjust health, damage, speed, range, and target selection.

Created the MannequinEditor plugin. Use /mannequin to summon an armored zombie mannequin. Right-click it in Creative mode to configure health, attack damage, speed, detection range, and whether it attacks everyone, one selected online player, or nobody. Its settings persist across reloads.

The mannequin uses a combat-capable zombie entity dressed with a player head and leather armor.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 543
src/main/java/com/kodari/mannequin/MannequinPlugin.java
package com.kodari.mannequin;

import org.bukkit.Location;
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 MannequinPlugin extends JavaPlugin implements CommandExecutor {
    private MannequinManager mannequinManager;

    @Override
    public void onEnable() {
        mannequinManager = new MannequinManager(this);
        getServer().getPluginManager().registerEvents(new MannequinListener(this), this);
        getCommand("mannequin").setExecutor(this);
    }

    public MannequinManager getMannequinManager() {
        return mannequinManager;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can summon a mannequin.");
            return true;
        }
        if (args.length != 0) {
            player.sendMessage("&cUsage: /mannequin");
            return true;
        }

        Location spawnLocation = player.getLocation().add(player.getLocation().getDirection().multiply(2));
        mannequinManager.spawn(spawnLocation);
        player.sendMessage("&aMannequin summoned. Right-click it in Creative mode to edit it.");
        return true;
    }
}