MASTER PROMPT: Minecraft Java Gun Plugin — Advanced Weapons System
Act as an expert Minecraft Java plugin developer. Create a complete, working, optimized, and well-organized Minecraft gun plugin for my Minecraft Java server.
- Plugin Information
- Plugin name: UltimateGuns
- Platform: Minecraft Java Edition
- Server software: Paper / Spigot
- Main language: Java
- Build system: Maven
- Plugin format: ".jar"
- Main goal: A complete guns, ammunition, crafting, and combat system for a Survival SMP server.
Before coding, ask me which Minecraft server version I use if it is not specified. Make the plugin compatible with that version and use the correct Paper/Spigot API.
- Include at Least 30 Different Guns
Create at least 30 unique guns divided into categories.
Pistols
- Glock 17
- Desert Eagle
- USP
- P250
- Revolver
SMGs
- Uzi
- MP5
- P90
- Vector
- UMP45
Assault Rifles
- AK-47
- M4A1
- SCAR-L
- AUG
- FAMAS
- Galil
- HK416
Sniper Rifles
- AWP
- SVD
- Barrett M82
- Mosin-Nagant
- Scout Rifle
Shotguns
- Pump Shotgun
- Double-Barrel Shotgun
- SPAS-12
- Sawed-Off Shotgun
Heavy Weapons and Special Guns
- M249
- Minigun
- RPG
- Crossbow Blaster
- Plasma Rifle
- Laser Gun
Each gun must have its own stats, custom appearance, firing sound, reload time, magazine capacity, damage, fire rate, and shooting behavior. Balance all weapons for Minecraft PvP and Survival gameplay.
- Gun Mechanics
Implement these mechanics:
- Right-click to fire.
- Left-click or a configurable key/action to reload, with a reliable alternative if the client cannot send a dedicated reload key.
- Different firing rates for pistols, SMGs, rifles, shotguns, and sniper rifles.
- Semi-automatic and automatic firing modes.
- Magazine-based ammunition.
- Reload animations or visual feedback.
- Headshot multipliers where technically feasible.
- Recoil and spread, if supported reliably by the chosen implementation.
- Bullet travel and hit detection.
- Optional projectile drop and bullet travel time.
- Different effective ranges for each gun.
- Custom gun sounds and muzzle effects where supported.
- Kill messages and damage indicators where configurable.
- Configurable friendly-fire behavior.
- Proper handling of creative mode, survival mode, PvP, and protected regions.
Avoid lag-producing repeating tasks. Use efficient event handling and clean up all temporary tasks and projectiles.
- Craftable Guns
Every craftable gun must have a unique recipe using Minecraft items.
Examples:
- AK-47: Iron Ingots, Iron Blocks, Redstone, and a Crossbow.
- Glock 17: Iron Ingots, Copper Ingots, and a Tripwire Hook.
- Sniper Rifle: Iron Blocks, Spyglass, Iron Ingots, and a Crossbow.
- Shotgun: Iron Ingots, Dispenser, and Tripwire Hook.
- Minigun: Iron Blocks, Redstone Blocks, Dispensers, and Iron Ingots.
These are example recipes; design sensible, balanced recipes for all weapons.
Requirements:
- Every recipe must work in a crafting table.
- Recipes must not conflict with vanilla recipes.
- Support shaped and shapeless recipes where appropriate.
- Give every gun a unique identity using custom model data, item components, or another version-compatible method.
- Prevent players from crafting guns that are disabled in the configuration.
- Make all recipes configurable in YAML.
- Ensure players cannot exploit recipes to duplicate weapons.
- Ammunition System
Create at least these ammunition types:
- Pistol Ammo
- Light Rifle Ammo
- Heavy Rifle Ammo
- SMG Ammo
- Shotgun Shells
- Sniper Ammo
- Heavy Ammo
- Rocket Ammo
- Energy Cells
Requirements:
- Ammo must be craftable.
- Each ammunition type must have its own crafting recipe.
- Different guns must accept only their assigned ammo type.
- Players must be able to carry ammunition in their inventory.
- Firing consumes one or more rounds according to the weapon.
- Reloading transfers ammo from the inventory into the magazine.
- Display current magazine ammunition and reserve ammunition.
- Prevent negative ammo counts and infinite-ammo exploits.
- Provide clear messages when ammunition runs out.
- Allow server administrators to configure ammo recipes, stack sizes, and crafting costs.
- Custom Items and Appearance
Use a reliable system to identify guns and ammunition.
- Use PersistentDataContainer or the correct version-compatible equivalent to identify custom items.
- Never identify weapons only by their display names.
- Prevent renamed vanilla items from becoming guns.
- Preserve weapon identity when players rename items in an anvil.
- Support resource-pack custom models as an optional feature.
- Without a resource pack, guns must still work using vanilla Minecraft items.
- Include custom item names and descriptions in the lore.
- Show gun stats and ammo information in item lore or an inventory interface.
- Commands and Permissions
Implement these commands:
/guns — Open the gun collection menu. /guns give <player> <gun> [amount] — Give a gun. /guns ammo <player> <ammo> [amount] — Give ammunition. /guns reload — Reload the held gun. /guns list — List all available weapons. /guns recipe <gun> — Display the recipe for a gun. /guns shop — Open an optional gun shop. /guns admin reload — Reload configuration. /guns admin giveall <player> — Give the configured weapon collection. /guns help — Display command help.
Permissions:
- ultimateguns.use
- ultimateguns.reload
- ultimateguns.craft
- ultimateguns.shop
- ultimateguns.admin
- ultimateguns.admin.give
- ultimateguns.admin.reload
Normal players should be able to use and craft permitted guns without OP. Administrative commands must require permissions.
- Gun GUI
Create a clean inventory GUI that includes:
- Gun categories.
- Gun icons and descriptions.
- Damage and fire-rate information.
- Magazine size and reload duration.
- Required ammunition type.
- Crafting recipe preview.
- Optional shop prices.
- Page navigation for more than 30 guns.
The GUI must prevent item theft, duplication, and unwanted movement of menu items.
- Configuration Files
Generate these files:
- "config.yml"
- "guns.yml"
- "ammo.yml"
- "recipes.yml"
- "messages.yml"
- "shops.yml"
Allow administrators to change damage, fire rate, reload duration, magazine size, range, spread, crafting recipes, ammunition types, sounds, permissions, and weapon availability without recompiling the plugin.
Include sensible defaults and comments explaining each setting.
- Compatibility and Security
- Use a stable Paper API compatible with my selected Minecraft version.
- Include a valid "plugin.yml".
- Register all commands, permissions, listeners, and crafting recipes correctly.
- Ensure compatibility with EssentialsX and LuckPerms.
- Avoid NMS and reflection unless absolutely necessary.
- Do not require a premium dependency.
- Do not require a client-side mod.
- Do not overwrite unrelated server plugins or vanilla behavior.
- Validate every command argument and player input.
- Prevent item duplication, ammo duplication, cooldown bypasses, and invalid weapon manipulation.
- Make weapon behavior configurable for WorldGuard-protected regions if integration is supported.
- Make the plugin safe for multiplayer servers and efficient with many players.
- Complete Deliverables
Do not just provide example code, pseudocode, or a tutorial.
Generate the complete Maven project with:
- All Java source files.
- Correct package structure.
- "pom.xml".
- "plugin.yml".
- All default YAML configuration files.
- All 30+ fully implemented weapons.
- All ammunition types and recipes.
- Command handlers and permission checks.
- GUI implementation.
- Installation instructions.
- A README explaining configuration and usage.
- Build instructions that produce "UltimateGuns.jar".
Every class must contain real working code. Do not leave TODOs, placeholder implementations, missing methods, or fake features.
Compile the project and fix all compilation errors before declaring it complete. Test the important mechanics, including shooting, reloading, ammo consumption, crafting, permissions, GUI interaction, and plugin startup. If you cannot run a Minecraft server for testing, clearly state which tests were not performed.
Deliver the complete project as a ZIP file and the compiled JAR if your environment supports file creation and compilation. If you cannot create files directly, provide the complete source project in clearly labeled files.
Start by confirming my Minecraft version and then build the plugin in manageable stages without sacrificing completeness.
Which Minecraft server version should UltimateGuns target (for example, 1.20.4 or 1.21.4)? Should I target Paper, Spigot, or both?
No files in this session