Aesthetic OP

Create a complete, production-ready Minecraft Java plugin called DragonBalls for Paper/Purpur 1.21.11.

The plugin should add a Dragon Ball collection system inspired by the Dragon Ball anime, while using original Minecraft-compatible assets and mechanics.

  1. ADMIN COMMAND

Add the command:

"/dragonball"

Only players with OP or the permission:

"dragonballs.admin"

can use this command.

When an admin executes "/dragonball":

  • Spawn exactly 7 Dragon Balls in the world.
  • The Dragon Balls should spawn at random locations around the command executor.
  • Each Dragon Ball should be approximately 1000 blocks away from the executor's current location.
  • Use random directions/angles so the locations are unpredictable.
  • Avoid spawning them inside blocks, underground, inside liquids, or in dangerous locations when possible.
  • Find a safe surface location near the calculated coordinates.
  • Each of the 7 Dragon Balls must have a unique identity:

- 1-Star Dragon Ball - 2-Star Dragon Ball - 3-Star Dragon Ball - 4-Star Dragon Ball - 5-Star Dragon Ball - 6-Star Dragon Ball - 7-Star Dragon Ball

The plugin must ensure that the 7 Dragon Balls are not duplicated.

If "/dragonball" is executed while an existing Dragon Ball event is active, either:

  • prevent another event from starting and tell the admin that the 7 Dragon Balls already exist, OR
  • add a configuration option allowing multiple events.

Default behavior should prevent duplicate active sets.

  1. PLAYER COORDINATES

When the Dragon Balls are spawned, ALL online players should receive their coordinates.

Display the coordinates using yellow text.

Example:

"✦ Dragon Ball detected!" "X: 1250 Y: 72 Z: -840"

The message should clearly identify which Dragon Ball it belongs to:

"✦ 4-Star Dragon Ball" "Location: X: 1250 Y: 72 Z: -840"

Coordinates should be visible to every online player.

Add a configuration option for whether coordinates should:

  • appear once when spawned,
  • appear periodically,
  • or both.

Default: show once when the Dragon Balls spawn.

  1. DRAGON BALL ITEM

Create custom Dragon Ball items.

Each Dragon Ball should have:

  • Custom name
  • Unique lore
  • Unique custom model data if resource-pack support is enabled
  • Glowing visual effect
  • A distinctive appearance
  • PersistentDataContainer data identifying the exact Dragon Ball number

Example names:

"★ 1-Star Dragon Ball" "★★ 2-Star Dragon Ball" "★★★ 3-Star Dragon Ball"

Do NOT identify Dragon Balls only by their display name. Use PersistentDataContainer/custom item data so renamed or copied items cannot bypass the system.

The 7 Dragon Balls must be collectible by players.

  1. COLLECTION SYSTEM

Players can pick up Dragon Balls normally.

The plugin must track which Dragon Balls a player owns.

A player should be able to collect all 7 unique Dragon Balls.

Prevent exploits such as:

  • duplicating Dragon Balls
  • placing/copying them through unintended mechanics
  • using renamed items as real Dragon Balls
  • creating fake Dragon Balls
  • bypassing the 7-ball requirement

The plugin should support saving player collection data so it survives server restarts.

  1. DRAGON SPAWNER TABLE

Create a special custom block called:

Dragon Spawner

The Dragon Spawner is crafted using:

  • 4 Diamonds
  • 1 Totem of Undying
  • 4 Obsidian

Create a custom crafting recipe for it.

The recipe should be configurable.

Suggested recipe:

"Obsidian | Diamond | Obsidian" "Diamond | Totem | Diamond" "Obsidian | Diamond | Obsidian"

Result:

"Dragon Spawner"

The Dragon Spawner should have a special name and lore.

  1. DRAGON SPAWNER GUI

When a player interacts with the Dragon Spawner, open a custom GUI.

The GUI must contain exactly 7 Dragon Ball slots.

Example:

"[ 1★ ] [ 2★ ] [ 3★ ] [ 4★ ] [ 5★ ] [ 6★ ] [ 7★ ]"

The GUI should clearly tell the player:

"Place all 7 Dragon Balls to summon the Dragon."

Each slot should accept only its corresponding Dragon Ball.

For example:

  • Slot 1 accepts 1-Star Dragon Ball
  • Slot 2 accepts 2-Star Dragon Ball
  • Slot 3 accepts 3-Star Dragon Ball
  • Slot 4 accepts 4-Star Dragon Ball
  • Slot 5 accepts 5-Star Dragon Ball
  • Slot 6 accepts 6-Star Dragon Ball
  • Slot 7 accepts 7-Star Dragon Ball

Do not allow normal items to be inserted into these slots.

Players should be able to take their Dragon Balls back if the summoning requirements are not completed.

  1. SUMMONING THE DRAGON

When all 7 Dragon Balls are correctly placed:

  • Verify that all 7 are genuine Dragon Ball items.
  • Verify that they belong to the required unique IDs.
  • Prevent duplicate/fake items from satisfying the requirement.
  • Start a Dragon summoning sequence.

Before the Dragon appears:

  1. Play dramatic sounds.
  2. Create particles around the Dragon Spawner.
  3. Create lightning-like visual effects without damaging players or terrain.
  4. Broadcast a server-wide message.

Example:

"✦ The 7 Dragon Balls have been gathered!" "✦ The Dragon is awakening..."

Then summon the custom Dragon.

  1. DRAGON ENTITY

Create a custom Dragon entity or use a configurable Minecraft entity as the base.

The Dragon should:

  • Have a custom name such as "Shenron"
  • Be visually impressive
  • Have increased health
  • Be invulnerable during the summoning animation
  • Have custom particles
  • Have custom sounds
  • Not immediately attack players
  • Hover/fly if possible
  • Remain near the Dragon Spawner during the wish sequence

If a fully custom model requires a resource pack, structure the plugin so that the resource-pack model can be added later.

The plugin must still function without a resource pack.

  1. WISH SYSTEM

After the Dragon is summoned, open a GUI to the player who activated the Dragon Spawner.

Create configurable wishes.

Example wishes:

  1. "Give me Diamonds"
  2. "Give me Netherite"
  3. "Give me Experience"
  4. "Give me Gold"
  5. "Give me a special item"
  6. "Give me a random reward"

Make the reward system configurable through a YAML file.

For example:

"config.yml"

wishes: diamonds: enabled: true amount: 32

netherite: enabled: true amount: 4

experience: enabled: true amount: 500

gold: enabled: true amount: 64

Make it easy for server administrators to add additional wishes.

  1. DRAGON BALL RESET

After a successful wish:

  • Consume the 7 Dragon Balls.
  • Remove them from the Dragon Spawner.
  • End the current Dragon Ball event.
  • The Dragon should disappear after the wish.
  • Save the completed event state.

Optionally make the Dragon Balls respawnable using:

"/dragonball"

after the previous event has been completed.

  1. DEATH / DROPPING

Dragon Balls should behave like normal collectible items.

If a player dies while carrying Dragon Balls:

  • They should drop normally unless configured otherwise.
  • Other players can pick them up.

Add a configuration option:

dragonballs: drop-on-death: true

  1. WORLD RESTART / SERVER RESTART

The plugin must save:

  • Active Dragon Ball locations
  • Which Dragon Balls have been collected
  • Which player owns each Dragon Ball
  • Active Dragon Spawner data
  • Dragon event state

When the server restarts, the plugin should restore the event correctly.

Do not create duplicate Dragon Balls after restarting.

  1. COMMANDS

Implement:

"/dragonball"

Admin command to spawn the 7 Dragon Balls.

"/dragonball reload"

Reload configuration.

"/dragonball locate"

Show the current active Dragon Ball locations to the command executor.

"/dragonball reset"

Admin-only command to remove/reset the active Dragon Ball event.

"/dragonball help"

Show command information.

Add appropriate permissions:

"dragonballs.admin" "dragonballs.reload" "dragonballs.reset" "dragonballs.locate"

  1. CONFIGURATION

Create a detailed "config.yml".

Include settings for:

  • Spawn distance
  • Minimum distance between Dragon Balls
  • World selection
  • Coordinate display
  • Coordinate display color
  • Dragon Ball drop behavior
  • Crafting recipe
  • Dragon health
  • Dragon damage
  • Dragon despawn time
  • Wish rewards
  • Sounds
  • Particles
  • Messages
  • Resource-pack/custom-model-data settings
  • Whether multiple Dragon Ball events are allowed

Example:

dragonballs: spawn-distance: 1000 minimum-distance-between-balls: 200 drop-on-death: true

display: show-coordinates: true coordinate-color: YELLOW

dragon: name: "Shenron" health: 1000 damage: 0 despawn-after-wish: true

events: allow-multiple-events: false

  1. RANDOM SPAWN LOCATION ALGORITHM

The spawn algorithm must be reliable.

For each Dragon Ball:

  1. Generate a random angle between 0 and 360 degrees.
  2. Generate a distance close to 1000 blocks.
  3. Calculate X/Z coordinates from the player's location.
  4. Find a safe Y coordinate.
  5. Check that the location is valid.
  6. Check that it is not too close to another Dragon Ball.
  7. Check that it is not inside dangerous terrain.
  8. If invalid, generate another location.
  9. Spawn the Dragon Ball.

Avoid generating all 7 balls in similar directions.

Make the minimum distance between Dragon Balls configurable.

  1. PERFORMANCE

The plugin must be optimized for multiplayer servers.

Do NOT constantly scan thousands of blocks.

Do NOT run expensive synchronous operations every tick.

Use efficient asynchronous calculations where appropriate, but perform Bukkit/Paper world/entity operations on the correct server thread.

Avoid unnecessary particle/sound spam.

The plugin should support at least 20–100 players without causing noticeable server lag.

  1. SECURITY / EXPLOIT PREVENTION

Protect against:

  • Item duplication
  • GUI duplication exploits
  • Shift-click exploits
  • Hopper exploits
  • Dropping items into invalid GUI slots
  • Fake Dragon Balls
  • Renamed items
  • Item stacking exploits
  • Plugin reload duplication
  • Server restart duplication
  • Multiple simultaneous summoning attempts

Use PersistentDataContainer for item identification.

  1. MESSAGES

Create "messages.yml" so server owners can customize all messages.

Example:

dragonball-spawned: "&e✦ The 7 Dragon Balls have appeared!" coordinates: "&e✦ {ball} &eLocation: X: {x} Y: {y} Z: {z}" already-active: "&cA Dragon Ball event is already active!" not-enough-balls: "&cYou need all 7 Dragon Balls." summoning: "&e✦ The Dragon is awakening..." wish-complete: "&a✦ Your wish has been granted!"

Support Minecraft color codes.

  1. PROJECT STRUCTURE

Create a complete Gradle or Maven project.

Use a clean structure such as:

src/main/java/ com.example.dragonballs/ DragonBallsPlugin.java command/ listener/ manager/ entity/ gui/ item/ storage/ util/ config/

Include:

  • "plugin.yml"
  • "config.yml"
  • "messages.yml"
  • Complete Java source code
  • Build configuration
  • README.md
  • Installation instructions
  • Permission documentation
  • Command documentation
  • Configuration documentation
  1. CODE QUALITY

Use modern Java suitable for Paper 1.21.11.

Requirements:

  • Clean object-oriented design
  • No deprecated APIs where avoidable
  • Null safety
  • Proper event handling
  • Proper inventory handling
  • Persistent storage
  • Error handling
  • Useful comments
  • No placeholder methods
  • No pseudocode
  • No missing classes
  • No "TODO" sections that prevent compilation

The final project must compile successfully and produce a working ".jar" plugin.

  1. IMPORTANT FINAL REQUIREMENT

Do not simply explain how to make the plugin.

Actually generate the complete source code for the entire plugin, including every required Java class, configuration file, plugin.yml, build file, and README.

Make sure all classes reference each other correctly and that the project is internally consistent and compilable.

If a feature cannot be implemented exactly using the Paper API, implement the closest reliable Paper-compatible solution and clearly document the limitation.

The final result should feel like a polished multiplayer Dragon Ball adventure/event plugin, not a simple command that spawns seven items.

Kodari AI
KodariSep 23 at 5:58 pm 3
DragonBalls
A comprehensive Paper plugin implementing a Dragon Ball collection event system. Admins spawn 7 unique Dragon Balls at random safe locations around them, broadcasting coordinates to all players. Players collect and store Dragon Balls with persistent identity tracking. A craftable Dragon Spawner block opens a GUI requiring all 7 authentic balls to summon a custom Dragon entity. The Dragon grants configurable wishes from YAML, then consumes the balls and resets the event. Features include persistent storage, anti-exploit protection, configurable messages, sounds, particles, and full admin commands with permissions.
  • Create the Paper 1.21.11 Gradle project, plugin metadata, permissions, and configurable defaults.

  • Implement persistent Dragon Ball identities, safe randomized spawning, coordinate announcements, and admin commands.

  • Add the crafted Dragon Spawner, its protected seven-slot GUI, summoning sequence, dragon, and configurable wishes.

  • Include operational and configuration documentation.

Created the DragonBalls Paper/Purpur 1.21.11 project with persistent ball identities and event state, randomized surface spawning, admin commands, the crafted Dragon Spawner and seven-slot GUI, a summoning sequence, configurable wishes, and player-facing configuration and installation documentation.

Build it with gradle build; the JAR output will be build/libs/DragonBalls-1.0.0.jar.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
13 1,620
src/main/java/com/kodari/dragonballs/DragonBallsPlugin.java
package com.kodari.dragonballs;

import com.kodari.dragonballs.command.DragonBallCommand;
import com.kodari.dragonballs.listener.DragonBallListener;
import com.kodari.dragonballs.listener.DragonSpawnerListener;
import com.kodari.dragonballs.manager.DragonBallManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.util.Map;

public final class DragonBallsPlugin extends JavaPlugin {
    private NamespacedKey ballKindKey;
    private NamespacedKey ballTokenKey;
    private NamespacedKey ballNumberKey;
    private NamespacedKey ballEventKey;
    private NamespacedKey spawnerItemKey;
    private NamespacedKey spawnerBlockKey;
    private YamlConfiguration messages;
    private DragonBallManager manager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        if (!new File(getDataFolder(), "messages.yml").exists()) {
            saveResource("messages.yml", false);
        }
        initializeKeys();
        loadMessages();
        manager = new DragonBallManager(this);
        manager.loadState();
        Bukkit.getPluginManager().registerEvents(new DragonBallListener(this, manager), this);
        Bukkit.getPluginManager().registerEvents(new DragonSpawnerListener(this, manager), this);
        getCommand("dragonball").setExecutor(new DragonBallCommand(this, manager));
        registerSpawnerRecipe();
        manager.restoreWorldBalls();
        manager.configureCoordinateAnnouncements();
    }

    @Override
    public void onDisable() {
        if (manager != null) {
            manager.saveState();
        }
    }

    private void initializeKeys() {
        ballKindKey = new NamespacedKey(this, "item_kind");
        ballTokenKey = new NamespacedKey(this, "ball_token");
        ballNumberKey = new NamespacedKey(this, "ball_number");
        ballEventKey = new NamespacedKey(this, "event_id");
        spawnerItemKey = new NamespacedKey(this, "dragon_spawner_item");
        spawnerBlockKey = new NamespacedKey(this, "dragon_spawner_block");
    }

    public void reloadPlugin() {
        reloadConfig();
        loadMessages();
        registerSpawnerRecipe();
        manager.configureCoordinateAnnouncements();
    }

    private void loadMessages() {
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
    }

    private void registerSpawnerRecipe() {
        NamespacedKey recipeKey = new NamespacedKey(this, "dragon_spawner");
        Bukkit.removeRecipe(recipeKey);
        var result = manager.createSpawnerItem();
        if (result == null) {
            getLogger().severe("Dragon Spawner recipe was not registered: configured result material is invalid.");
            return;
        }
        var shape = getConfig().getStringList("dragon-spawner.recipe.shape");
        var ingredients = getConfig().getConfigurationSection("dragon-spawner.recipe.ingredients");
        if (shape.size() != 3 || ingredients == null || shape.stream().anyMatch(row -> row.length() != 3)) {
            getLogger().severe("Dragon Spawner recipe must define three rows of three characters and ingredients.");
            return;
        }
        var recipe = new org.bukkit.inventory.ShapedRecipe(recipeKey, result);
        recipe.shape(shape.toArray(String[]::new));
        for (String symbol : ingredients.getKeys(false)) {
            if (symbol.length() != 1) {
                continue;
            }
            String materialName = ingredients.getString(symbol);
            if (materialName == null) {
                continue;
            }
            com.cryptomorin.xseries.XMaterial.matchXMaterial(materialName)
                    .map(com.cryptomorin.xseries.XMaterial::parseMaterial)
                    .ifPresent(material -> recipe.setIngredient(symbol.charAt(0), material));
        }
        Bukkit.addRecipe(recipe);
    }

    public String message(String key, Map<String, String> replacements) {
        String value = messages.getString(key, getConfig().getString("messages." + key, ""));
        for (Map.Entry<String, String> replacement : replacements.entrySet()) {
            value = value.replace("{" + replacement.getKey() + "}", replacement.getValue());
        }
        return ChatColor.translateAlternateColorCodes('&', value);
    }

    public void sendMessage(CommandSender sender, String key) {
        sender.sendMessage(message(key, Map.of()));
    }

    public void sendHelp(CommandSender sender) {
        for (String line : messages.getStringList("help")) {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', line));
        }
    }

    public NamespacedKey ballKindKey() { return ballKindKey; }
    public NamespacedKey ballTokenKey() { return ballTokenKey; }
    public NamespacedKey ballNumberKey() { return ballNumberKey; }
    public NamespacedKey ballEventKey() { return ballEventKey; }
    public NamespacedKey spawnerItemKey() { return spawnerItemKey; }
    public NamespacedKey spawnerBlockKey() { return spawnerBlockKey; }
    public DragonBallManager manager() { return manager; }
}