Create a complete, production-ready Minecraft Java Paper plugin named "LetilBattle".
TARGET:
- Paper Minecraft 1.21.x
- Java 21
- Plugin name: LetilBattle
- Main package: com.letilbattle
- Build a real working .jar, not just example code.
- The final plugin must compile successfully with Maven.
GAME MODE:
This is a battle-royale survival game based around a custom item called "Letil".
LETIL SYSTEM:
- Every player starts with exactly 10 Letil items.
- Letil should be a clearly recognizable custom item named "§b§lLetil".
- Players can pick Letil items up from the ground.
- Letil items can stack.
- When a player kills another player, exactly 1 Letil is dropped from the dead player.
- The killer can pick that Letil up.
- A player can therefore have more than 10 Letil.
- Every time a player dies, remove exactly 1 Letil from their inventory and drop that Letil at their death location.
- If a player has 0 Letil remaining, they are eliminated permanently and cannot respawn/rejoin the active match.
- Do not accidentally remove multiple Letils from a death.
- Track active/eliminated players safely.
BORDER:
- Create a large WorldBorder centered around the world's spawn point.
- Initial border should be approximately 2500 blocks wide.
- Every 20 minutes the border must shrink.
- Make the shrink noticeable but gradual.
- Never shrink below approximately 50 blocks.
- Announce each border shrink to all players.
- Players outside the border should receive normal Minecraft border damage/behavior.
- The game ends when only one active player remains.
- Announce the winner prominently.
RANDOM LETIL SPAWNS:
- Periodically spawn individual Letil items at random safe locations inside the current WorldBorder.
- Spawn them on the highest safe block, not underground or inside blocks.
- Keep spawning them throughout the match.
- Do not spawn them outside the current border.
LETIL MARKET INVENTORY GUI:
When a player RIGHT-CLICKS a Letil item, open a chest-style inventory INVENTORY GUI instead of simply doing nothing.
Title: "§b§lLETIL MARKET"
The INVENTORY GUI must contain these purchasable abilities/items:
- FLIGHT
- Cost: 3 Letil.
- INVENTORY GUI item name: "§bUçuş"
- Description: "§710 saniye uçuş"
- When purchased, give the player flight for exactly 10 seconds.
- Show a visible countdown/action-bar message during flight.
- After flight ends, disable flight unless the player normally has permission to fly.
- Flight cooldown: 3 minutes.
- During cooldown, the INVENTORY GUI item must show the remaining cooldown.
- Do not allow purchase while cooling down.
- INVISIBILITY
- Cost: 2 Letil.
- INVENTORY GUI item name: "§7Görünmezlik"
- Duration: exactly 4 seconds.
- Apply real Minecraft invisibility.
- Show cooldown in the INVENTORY GUI.
- Cooldown: exactly 1 minute.
- Do not allow purchase while cooling down.
- FULL DIAMOND ARMOR
- Cost: 5 Letil.
- INVENTORY GUI item name: "§bFull Elmas Set"
- Purchase gives:
Diamond Helmet Diamond Chestplate Diamond Leggings Diamond Boots
- Do not duplicate armor incorrectly.
- If inventory is full, handle the purchase safely.
- SHARPNESS V IRON SWORD
- Cost: 3 Letil.
- INVENTORY GUI item name: "§fKeskinlik V Demir Kılıç"
- Give one Iron Sword enchanted with Sharpness V.
- Handle inventory-full situations safely.
- SUPER JUMP
- Cost: 3 Letil.
- INVENTORY GUI item name: "§aSüper Zıplama"
- This is a toggleable permanent ability after purchase.
- Player can turn it ON and OFF whenever they want.
- When enabled, jumping should launch the player approximately 5 blocks high.
- The special jump must prevent all fall damage caused by that special jump.
- Normal jumps/fall damage must remain normal.
- Show the current state (ON/OFF) in the INVENTORY GUI.
- Do not require repeatedly spending Letil after purchasing it.
INVENTORY GUI BEHAVIOR:
- Clicking a purchase item must safely check the player's Letil balance.
- If insufficient Letil, show a clear message.
- On successful purchase, remove the exact required number of Letil.
- The INVENTORY GUI should update immediately.
- Prevent item duplication/exploits.
- Prevent taking the INVENTORY GUI's display items out of the inventory.
- Right-clicking the Letil item itself opens the INVENTORY GUI.
- Normal left-click behavior should not accidentally activate the market.
- Add useful visual formatting and item lore.
GAME COMMANDS:
Add: /letil start /letil stop /letil spawn /letil info /letil give <player> <amount>
Commands should require OP/permission: letilbattle.admin
/letil start:
- Start/reset a match.
- Give every participating player exactly 10 Letil.
- Reset eliminations.
- Reset cooldowns.
- Reset border to its starting size.
- Announce match start.
/letil stop:
- Stop the active match safely.
/letil spawn:
- Spawn one random Letil inside the current border.
/letil info:
- Show the player's current Letil count and ability cooldowns.
DATA / SAFETY:
- Store active player state safely.
- Clean up cooldowns when players leave.
- Prevent exploits from inventory clicks, death drops, reconnects, and INVENTORY GUI interactions.
- Do not depend on external plugins.
- Use only the Paper API.
- Use persistent data / item metadata so normal Nether Stars cannot be mistaken for Letil.
- Avoid deprecated APIs where possible.
- Make the plugin reload-safe as much as possible.
- Include plugin.yml.
- Include pom.xml.
- Organize code into multiple clean Java classes if appropriate.
- Add comments explaining important game logic.
IMPORTANT:
This must be a COMPLETE WORKING PLUGIN.
Do not give me pseudocode.
Do not give me a tutorial.
Generate all required Java files, plugin.yml and pom.xml.
Compile the project.
Fix compilation errors automatically.
Return the final compiled LetilBattle.jar.