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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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:
- Play dramatic sounds.
- Create particles around the Dragon Spawner.
- Create lightning-like visual effects without damaging players or terrain.
- Broadcast a server-wide message.
Example:
"✦ The 7 Dragon Balls have been gathered!" "✦ The Dragon is awakening..."
Then summon the custom Dragon.
- 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.
- WISH SYSTEM
After the Dragon is summoned, open a GUI to the player who activated the Dragon Spawner.
Create configurable wishes.
Example wishes:
- "Give me Diamonds"
- "Give me Netherite"
- "Give me Experience"
- "Give me Gold"
- "Give me a special item"
- "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.
- 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.
- 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
- 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.
- 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"
- 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
- RANDOM SPAWN LOCATION ALGORITHM
The spawn algorithm must be reliable.
For each Dragon Ball:
- Generate a random angle between 0 and 360 degrees.
- Generate a distance close to 1000 blocks.
- Calculate X/Z coordinates from the player's location.
- Find a safe Y coordinate.
- Check that the location is valid.
- Check that it is not too close to another Dragon Ball.
- Check that it is not inside dangerous terrain.
- If invalid, generate another location.
- Spawn the Dragon Ball.
Avoid generating all 7 balls in similar directions.
Make the minimum distance between Dragon Balls configurable.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.