Create a complete, functional Minecraft Shop plugin for Paper 1.21.11 using Java and Maven.
Plugin name: AdmiralShop
- Main Features
- Create a fully interactive shop GUI.
- Integrate with Vault for economy transactions.
- Support EssentialsX Economy or any compatible Vault economy provider.
- Add four shop categories: End, Nether, Gear, and Food.
- Use beautiful Unicode text in GUI titles.
- Support Minecraft legacy color codes (&a, &c, &l) and modern hex colors (#RRGGBB).
- Allow players to purchase items through the GUI.
- Add quantity selection before purchasing.
- Display item prices in GUI lore.
- Check player balances before every transaction.
- Check inventory space before giving purchased items.
- Deduct money correctly and give items only after successful transactions.
- Play sounds for successful and unsuccessful purchases.
- Prevent item duplication and economy exploits.
- Support configurable messages, item prices, sounds, and GUI titles.
- GUI Titles
Configure these titles in config.yml:
gui: main-shop-title: "ѕʜᴏᴘ" end-shop-title: "ѕʜᴏᴘ - ᴇɴᴅ" nether-shop-title: "ѕʜᴏᴘ - ɴᴇᴛʜᴇʀ" gear-shop-title: "ѕʜᴏᴘ - ɢᴇᴀʀ" food-shop-title: "ѕʜᴏᴘ - ꜰᴏᴏᴅ"
- Configurable Messages
messages: not-enough-money: "&cYou don't have enough money." inventory-full: "&cYour inventory is full." purchase-success: "&aPurchase successful!" purchase-failed: "&cPurchase failed." shop-opened: "&aShop opened successfully." invalid-amount: "&cInvalid purchase amount." reload-success: "&aShop configuration reloaded." no-permission: "&cYou don't have permission."
- Sound Configuration
sounds: purchase-successful: "ENTITY_EXPERIENCE_ORB_PICKUP" purchase-successful-volume: 0.5 purchase-unsuccessful: "ENTITY_VILLAGER_NO" click: "UI_BUTTON_CLICK"
- Shop Categories and Items
End Shop
- Ender Chest
- Ender Pearls
- End Stone
- Dragon Breath
- Chorus Fruit
- Shulker Shells
Nether Shop
- Blaze Rods
- Nether Wart
- Glowstone Dust
- Magma Cream
- Ghast Tears
- Nether Quartz
Gear Shop
- Obsidian
- End Crystals
- Respawn Anchors
- Totems of Undying
- Golden Apples
- Arrows
Food Shop
- Potatoes
- Sweet Berries
- Carrots
- Apples
- Cooked Chicken
- Steak
- Golden Carrots
- Sample Prices
prices: enderchest: 2500 blazerod: 150 totemofundying: 1250 steak: 35
Add reasonable default prices for all other items. Make all prices configurable in config.yml.
- Commands
/shop
/shop reload
- Reloads the plugin configuration.
- Requires admiralshop.admin permission.
/shop help
- Shows available commands.
Permissions:
- admiralshop.use
- admiralshop.admin
- GUI Design
- Main menu displays four category buttons.
- Each category opens its own inventory GUI.
- Each item displays its name, price, and purchase instructions in its lore.
- Add a Back button to return to the previous menu.
- Add a Close button to close the GUI.
- Use decorative glass panes where appropriate.
- Use a consistent, professional design.
- Prevent players from taking decorative items or shop icons from the GUI.
- Support configurable GUI sizes and item slots.
- Quantity Selection
When a player clicks an item:
- Open a quantity selection GUI.
- Provide buttons for purchasing 1, 8, 16, 32, or 64 items.
- Include a custom amount option if practical.
- Display the total cost before confirming.
- Provide Confirm, Cancel, and Back buttons.
- Validate the player's balance and inventory space.
- Never charge money if the purchase fails.
- Economy Integration
- Use Vault's Economy API.
- Check that Vault and an economy provider are installed.
- Disable the plugin gracefully if the required dependencies are missing.
- Never modify player balances using unsupported methods.
- Handle transaction failures safely.
- Prevent negative prices and invalid quantities.
- Do not allow players to manipulate GUI items to obtain free items.
- Technical Requirements
- Use Java compatible with Paper 1.21.11.
- Use Maven for building.
- Provide a complete pom.xml.
- Provide plugin.yml with the correct main class, commands, permissions, API version, and dependencies.
- Provide config.yml with all categories, items, prices, messages, sounds, and GUI titles.
- Organize the Java code into clean, maintainable classes.
- Use Bukkit/Paper APIs correctly.
- Ensure GUI click and drag events are handled safely.
- Use InventoryHolder or another reliable method to identify plugin GUIs.
- Validate all configuration values.
- Avoid deprecated APIs where possible.
- Make sure all inventory operations run on the appropriate server thread.
- Expected Output
Generate the complete project, including:
- Project directory structure.
- All Java source files.
- pom.xml.
- plugin.yml.
- config.yml.
- README.md with installation and usage instructions.
- Build instructions for generating the final JAR file.
- Clear instructions for installing the plugin on a Paper server hosted by MCServerHost.
Do not provide pseudocode or incomplete examples. Generate the actual, complete, compilable source code for every required file.
Before finishing, check for compilation errors, missing dependencies, incorrect Material names, invalid YAML syntax, and compatibility with Paper 1.21.11.
The final goal is a working Minecraft Shop plugin that I can compile into a JAR file and install directly on my server.