Y
📎 1 file 6,986 chars
📄
pasted-code-1779592412716.txt
txt 83 lines
▶
Create a comprehensive, highly detailed, production-ready technical specification for a Spigot/Paper Minecraft plugin tailored for a private "Red Moon SMP". This is MODULE 4 (THE 5-WAY RANDOMIZED EVENT ENGINE).

STRICT RULES:
1. No automatic background day/night counters for events. Events must ONLY trigger when an admin executes the command.
2. Absolutely NO Scoreboard HUD, sidebars, or virtual economy/tokens. Keep the player's screen completely vanilla.

This module must integrate flawlessly with all data systems, items, and clans from Modules 1, 2, and 3.

==========================================================================================
1. 5-WAY RANDOMIZED GLOBAL EVENT CONTROLLER
==========================================================================================
When an administrator executes `/redmoon event start random`, the plugin must use a secure random pass (`java.util.Random`) to select and instantly launch exactly ONE of the following five global events (20% probability each):

------------------------------------------------------------------------------------------
EVENT 1: "The Blood Moon Eclipse" (Probability: 20%)
------------------------------------------------------------------------------------------
- Visual/Audio: Broadcast Title -> "§c§lBLOOD MOON", Subtitle -> "§4§oThe sky bleeds. Factions collide...". Sound -> `ENTITY_WITHER_DEATH` at max volume.
- Mechanics: Locks world time to night (`setTime(18000)`) and pauses the cycle for 15 minutes.
- Faction Scaling:
  * Vampires: 100% immune to sun damage. Grants Speed II, Strength II, and a passive 10% Lifesteal on melee hits.
  * Werewolves: Grants Speed III, Jump Boost III, and permanent Resistance II. Feral axe damage scales to 1.8x.

------------------------------------------------------------------------------------------
EVENT 2: "The Solar Flare" (Probability: 20%)
------------------------------------------------------------------------------------------
- Visual/Audio: Broadcast Title -> "§6§lSOLAR FLARE", Subtitle -> "§e§oThe sun burns with unholy fury...". Sound -> `ITEM_ELYTRA_FLYING` (amplified) and flame bursts at world spawn.
- Mechanics: Locks world time to broad daylight (`setTime(6000)`) and pauses the cycle for 10 minutes.
- Faction Scaling:
  * Vampires: Extreme danger. Sunlight damage is doubled (Takes 4.0 HP / 2 Hearts every 2 seconds). Potion debuffs upgraded to Slow II and Weakness II. "Sun-Shield Armor" takes 4x durability damage.
  * Werewolves: Completely unaffected (Standard human baseline).

------------------------------------------------------------------------------------------
EVENT 3: "The Reaper's Wrath" (Probability: 20%)
------------------------------------------------------------------------------------------
- Visual/Audio: Broadcast Title -> "§8§lREAPER'S WRATH", Subtitle -> "§c§oAn ancient terror has hunted you down...". Sound -> `ENTITY_ENDER_DRAGON_GROWL` globally.
- Mechanics: Instantly spawns the World Boss "§4§lThe Eclipse Reaper" directly on top of a randomly selected online player. 
- Boss Stats & AI:
  * Max Health: 500.0 HP. Immune to fire, drowning, fall damage, and splash health/harm potions.
  * Abilities (Every 15s): Uses "Shadow Pull" to drag players within 15 blocks to its location + inflicts Blindness, and summons 3-5 fast "§7Blood Thrall" zombies.
  * Loot: Drops 5x Enchanted Golden Apples, 3x Netherite Ingots, and a 15% chance to drop a random Legendary Weapon from Module 3.

------------------------------------------------------------------------------------------
EVENT 4: "The Lunar Curse" (Probability: 20%) -- NEW
------------------------------------------------------------------------------------------
- Visual/Audio: Broadcast Title -> "§2§lLUNAR CURSE", Subtitle -> "§a§oThe full moon drives the pack insane...". Sound -> Multiple overlapping `ENTITY_WOLF_HOWL` and `ENTITY_WOLF_GROWL` sounds.
- Mechanics: Locks world time to midnight (`setTime(18000)`) for 10 minutes.
- Faction Scaling:
  * Werewolves: Driven into an uncontrollable feral rage. They get permanent Strength II, Haste II, and Speed III, BUT they lose the ability to hold or use any items/weapons except their bare hands. Every 30 seconds, they are forced to sprint forward via automatic velocity vectors.
  * Vampires: Normal night attributes apply.

------------------------------------------------------------------------------------------
EVENT 5: "The Blood Rain" (Probability: 20%) -- NEW
------------------------------------------------------------------------------------------
- Visual/Audio: Broadcast Title -> "§4§lBLOOD RAIN", Subtitle -> "§c§oThe rain burns the living...". Sound -> Global thunder and constant `WEATHER_RAIN_BIG` effects.
- Mechanics: Forces global Thundering weather. Rain falls everywhere for 12 minutes.
- Faction Scaling:
  * All Normal/Human Players & Werewolves: If caught exposed under the open sky (no blocks above them), the toxic blood rain inflicts Poison I and Hunger I for 3 seconds, refreshing continuously.
  * Vampires: The blood rain feeds them. Being exposed under the open rain gives them permanent Regeneration I and Speed I buffs.

==========================================================================================
2. HARDCORE PVP RULES & FRIENDLY FIRE TRACKING
==========================================================================================
- Clan Kill Broadcasts & XP Penalty:
  * Intercept `PlayerDeathEvent`. If a Vampire kills a Werewolf, or a Werewolf kills a Vampire:
    - Broadcast: "§c§l[SMP] §f%killer% (%clan%) has executed %victim% (%clan%)!"
    - The victim loses 15% of their total experience levels as a survival penalty.
  * Friendly Fire Penalty (Treason): 
    - If a Vampire kills a Vampire, or a Werewolf kills a Werewolf, inflict `PotionEffectType.WITHER` Level III on the killer for 15 seconds.

==========================================================================================
3. ADMIN EVENT COMMAND MATRIX
==========================================================================================
All interactions require the 'redmoon.admin' permission node.
1. `/redmoon event start random`
   - Dynamically selects either Event 1, 2, 3, 4, or 5 randomly, executing its subtitles, sounds, and gameplay state overrides instantly.
2. `/redmoon event stop`
   - Instantly kills any active event, forces the world time cycle and weather to resume normally, clears the Reaper Boss entity safely, and strips event-specific modifiers.

==========================================================================================
TECHNICAL SPECIFICATIONS
==========================================================================================
- Use safe background threads for random calculations and cleanup tasks.
- Ensure proper cancellation of active BukkitRunnables when the `/redmoon event stop` override is triggered.
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code