Create a fully functional, optimized Minecraft plugin (Spigot/Paper 1.20+) in Java.
Plugin Name: PartyCore
MAIN IDEA:
When a player with permission executes /party, it creates a temporary "party zone" around them with visual effects, music, glowing players, and a disco-style environment.
CORE FEATURES:
- COMMAND SYSTEM:
- Command: /party
- Permission: party.use
- If player lacks permission โ send message: "You are not allowed to start a party!"
- Add tab completion support (optional future expansion).
- COOLDOWN SYSTEM:
- Each player has a 5-minute cooldown (300 seconds).
- If used during cooldown โ show remaining time in seconds.
- Cooldown must persist only during runtime (no database required).
- PARTY STRUCTURE (VISUAL ZONE):
- On command execution:
- Create a circular or square structure (radius: 5 blocks) centered on the player. - Structure should: - Replace floor blocks temporarily with random colored blocks (e.g., concrete, wool, glass). - Animate floor every 5 ticks (color cycling disco effect). - After 15 seconds โ restore original blocks perfectly.
- DISCO FLOOR SYSTEM:
- Store original block states before replacing.
- Randomize block colors continuously during party duration.
- Use scheduler (BukkitRunnable) for animation.
- Ensure no lag spikes (optimize block updates).
- PLAYER EFFECTS:
- Any player inside the party radius:
- Apply: - Glowing effect - Speed I - Jump Boost I - Night Vision (optional) - Add particles around players (e.g., NOTE, FIREWORK, END_ROD).
- Effects removed instantly when:
- Player leaves zone - Party ends
- JUKEBOX SYSTEM (IMPORTANT):
- Spawn a jukebox at center.
- Auto-play a random music disc.
- Stop music when party ends.
- Remove jukebox after duration.
- Ensure it doesn't drop items.
- PARTICLES & VISUALS:
- Spawn:
- Firework bursts periodically (no damage) - Colored particles around the structure
- Optional: rotating particle ring around center.
- SOUND SYSTEM:
- Play ambient party sounds:
- Note block sounds - Music disc audio
- Play sound every few ticks for immersion.
- PARTY DURATION:
- Total duration: 15 seconds
- After that:
- Remove all effects - Restore blocks - Remove jukebox - Stop all tasks
- MULTI-PARTY HANDLING:
- Allow multiple parties at different locations.
- Prevent overlap bugs.
- Each party runs independently.
- PERFORMANCE:
- Use efficient block storage (HashMap<Location, BlockData>)
- Avoid unnecessary chunk loads.
- Cancel all tasks after completion.
- MESSAGES:
- On start:
"๐ Party started!"
- On end:
"๐ถ Party ended!"
- On cooldown:
"Wait X seconds before partying again!"
- OPTIONAL ADVANCED FEATURES (ADD THESE):
- Party radius visual border (particles ring)
- Random fireworks colors
- Chance-based rare effects (e.g., levitation for 1 sec)
- Config.yml support:
- Duration - Cooldown - Radius - Enable/disable effects
- Action bar message during party:
"๐ PARTY ACTIVE ๐"
- CODE STRUCTURE:
- Main class (PartyCore.java)
- PartyManager class (handles active parties)
- CooldownManager class
- PartyTask (BukkitRunnable for animation)
- Utility class for block storage/restoration
- CLEAN CODE REQUIREMENTS:
- Use OOP principles
- Proper listeners if needed
- Comments explaining logic
- No memory leaks
- Register events & commands properly
OUTPUT:
- Full working Java plugin code
- plugin.yml included
- Clean and production-ready
Create a Minecraft plugin (Spigot/Paper 1.20+) named PartyCore.
When a player with permission "party.use" runs "/party", it creates a temporary party zone around them.
Core Features:
- Cooldown:
Each player has a 5-minute cooldown. If used early, show remaining time.
- Party Zone:
- Radius: 5 blocks around player
- Replace floor with random colored blocks (wool/concrete/glass)
- Animate colors every few ticks (disco effect)
- Store original blocks and restore after
- Duration:
- Lasts 15 seconds
- After that: restore blocks, remove effects, stop tasks
- Effects:
Players inside zone get:
- Glowing
- Speed I
- Jump Boost I
- Optional Night Vision
Remove effects when leaving or party ends
- Jukebox System:
- Spawn jukebox at center
- Play random music disc
- Stop music and remove jukebox after party
- Particles & Sounds:
- Note, firework, end rod particles
- Periodic fireworks (no damage)
- Play note/music sounds for vibe
- Multi-Party Support:
- Multiple parties can run at different locations
- No conflicts or overlaps
- Messages:
- Start: "๐ Party started!"
- End: "๐ถ Party ended!"
- Cooldown: "Wait X seconds!"
- Performance:
- Use HashMap<Location, BlockData>
- Optimize block updates
- Cancel all schedulers after use
- Advanced Features:
- Particle ring border
- Random fireworks colors
- Action bar: "๐ PARTY ACTIVE ๐"
- Rare effects (short levitation chance)
- Config.yml:
- Duration
- Cooldown
- Radius
- Toggle effects
- Code Structure:
- Main class (PartyCore)
- PartyManager
- CooldownManager
- PartyTask (animation)
- Utility for block restore
- Requirements:
- Clean OOP code
- Comments included
- No memory leaks
- Include plugin.yml
Output full working, production-ready code.