Items or Blocks
87 downloads
Description:
This mod adds the Reaper’s Harvest scythe and a full Halloween Arena experience—remade bosses, themed servants, polished visuals, and persistent soul progression for the weapon; bosses deal protection‑aware damage that scales down against heavily armored players for better balance. Use the scythe in your main hand: press F to spawn orbiting Pumpkin Sentinels that auto‑acquire targets and fire fast magical projectiles, and press-and-hold Y for 5 seconds to teleport into the Arena (hold Y again to request exit). The Soul Reaver variant grants Strength II for 5 seconds on kill with a 30‑second cooldown stored on the item, and all boss drops pass through a loot‑safety clamp that limits Resistance to III and substitutes gentler bonuses with a lore note. The Headless Horseman now reliably appears as a single Wither Skeleton with a Wither Skull, faster movement, and a “spectral horse” illusion made from smoke and soul particles plus a periodic gallop sound; it cannot break blocks, respects arena protections, and is tracked by the bossbar with its custom name and health.
Manage versions and create new iterations of this mod.
Click here for installation instructions
This will create a new version of "Reaper S Harvest" for Minecraft Java 1.20.1. The original mod will remain unchanged.
This mod is licensed under the CreativeMode Mods License.
This will create a new mod based on "Reaper S Harvest" with your modifications. The original mod will remain unchanged and you'll be credited as the author of the remix.
3
Nov 1, 2025, 08:46 PM
User request: Reaper’s Harvest — Machine-actionable authoritative summary (Fabric 1.21.5). Includes original spec + ALL edits through v171 and v172. Designed for implementer/agent consumption. Follow DataComponent & server-authoritative constraints exactly. IDENTIFIERS / PACKETS / KEYS - Packet IDs: - "reaper:flight" - "reaper:arena" (legacy) - v163 explicit: "reaper:arena_enter", "reaper:arena_exit" - Standard CUSTOM_DATA keys (authoritative): harvest_cd, dome_cd, reaper_cd (aka flight_cd), arena_cd, arena_entry_time, origin_x, origin_y, origin_z, total_bosses, bosses_killed, soul_count, damage_tier, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities, reaper:drops_handled, reaper:pending_loot (serialized), reward_delivered (bool), arena_death_pending (bool), soul_reaver_last_strength. - Treat missing CUSTOM_DATA keys as defaults (0/false). Use world.getTime() for timestamps. CORE ITEM / GENERAL RULES - ReapersHarvestItem extends SwordItem. - Stats: Attack=35, AttackSpeed=-2.4f, hasGlint() -> false. - ToolMaterial: Netherite. - All abilities server-authoritative. - All dynamic state MUST use DataComponentTypes.CUSTOM_DATA (ONLY small primitives) & DataComponentTypes.LORE. - NEVER store large collections (>100 items) or large block-position arrays in CUSTOM_DATA (v54 CRITICAL). - Allowed custom primitives (ONLY): small ints/longs/bools minimal coords/UUIDs: arena_center coords, dome_center coords, radii, cooldown_end timestamps (world.getTime()), soul_count, damage_tier, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities (UUIDs only), reaper:drops_handled. - Small lists of structure positions for a single dome (4–7) permitted (v161) — still respect v54 limits. - Use DataComponentTypes for enchantments, custom name, lore, attribute modifiers; DO NOT write raw NBT. THREADING, SCHEDULING & SAFETY - Server-authoritative. Schedule heavy ops via server.execute or server tick scheduler. NEVER Thread.sleep. - Spread heavy ops across ticks; validate ServerWorld & chunk loading before block/entity edits. - Defensive null checks; try/catch around particle/sound spawns. - Batch edits and particle bursts. Throttle loud sounds. - Implement spawnParticlesSafe(World, ParticleEffect, ...) wrapper: validate ServerWorld & !world.isClient, try/catch, cap and batch particles. - Log failures; ensure safe teleport/chunk validation. PARTICLE BUDGETS & THEME - Theme: jack-o’-lantern blade, purple ethereal mist, orange/black palette, constant purple particles/whispers. - Use vanilla sounds only (pitch/volume tweaks allowed). Dramatic particles and bossbars. - Particle budgets & recommended batching: - Haunted Dome ~15,000 SOUL_FIRE_FLAME over ~5s batched (v58 may cap ~3000 per event). - Soul Harvest 500 batched. - Soul Reaper pumpkins 40/tick. - Boss spawn 5,000 split across ticks. - Arena ambient 50 SOUL + 20 ASH per second. - Avoid huge single-tick bursts; cap per-event/ambient values. CONTROLS, UX & NETWORKING - Inputs: - Left Click = normal attack. - Right Click = Soul Harvest (use() override). - Shift + Right Click = Haunted Dome (use() override). - F Key = Soul Reaper (client KeyBinding mapped to FLIGHT_KEY). - Witch Flight = optional alternative to Soul Reaper. - Hold Y for 5s (100 ticks) = Halloween Arena mapped to ARENA_KEY. - Client: register Flight (F) & Arena (Y) KeyBindings in ClientModInitializer via KeyBindingHelper. ClientTickEvents.END_CLIENT_TICK handle keypress/hold and send packets only when main hand holds Reaper’s Harvest. - Client sends FlightPayload/ArenaPayload only when main-hand holds item. Server registers GlobalReceiver; on receive validate player/world/item ownership; server.execute schedule work. Packet handlers validate ownership and schedule rather than run heavy inline work. LORE & UI (SERVER AUTHORITATIVE; EXACT TEMPLATE & UPDATE SCHEDULE) - DataComponentTypes.LORE updated every 20 server ticks server-side using Text.literal().styled(s->s.withItalic(false)). v72/v82 atomic lore update; v94/v148 global refresh. - EVERY 20 TICKS scan all online players' inventories and rebuild lore from zero for every Reaper’s Harvest instance (v148/v154/v155 enforcement). - Status icons formatting (exactness required): - READY: " §a§l✔ READY" - COOLDOWN: " §c§l⏳ M:SS" (v96: alternative " §c§l⏳ {m}m {s}s") - ACTIVE: " §e§l⚡ ACTIVE" - Actionbar: hold‑Y progress percent, cooldowns and messages. Soul progress actionbar when collecting souls (v89). - EXACT LORE TEMPLATE (v89/v96 literal — MUST BE APPLIED VERBATIM server-side every 20 ticks using Text.literal().styled(.withItalic(false))): §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ REAPER'S HARVEST ⚔ §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ §7Damage: §f§l35 §8┃ §d§l✦ §7Souls: §5§l{soul_count} §6§l▬▬▬▬ §5§lCURSED POWERS §6§l▬▬▬▬ §6§l◈ Soul Harvest §8§o(Right Click) §7Reap the souls of your enemies §7in a deadly sweeping arc {cooldown_status} §d§l◆ Haunted Dome §8§o(Shift + Right Click) §7Summon a cursed glass prison §7with 10 pumpkin servants {cooldown_status} §5§l✦ Soul Reaper §8§o(Press F) §7Unleash 8 orbiting spectral §7scythes of pure nightmare {cooldown_status} §c§l☠ Halloween Arena §8§o(Hold Y - 5 sec) §7Enter the eternal battleground §7and face the Seven Horrors {cooldown_status} §8§l▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §6§o Halloween Edition By §f§lklow (Replace {cooldown_status} and {soul_count} dynamically; ready/cooldown/active strings must use specified formatting.) CORE CLASSES & METHODS (REQUIRED) - ReapersHarvestItem extends SwordItem: - Implement: use(); activateHauntedDome(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulHarvest(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulReaper(...)/activateWitchFlight(...); activateArena(ServerWorld, ServerPlayerEntity, ItemStack). - use(): server-only: if user.isSneaking() -> activateHauntedDome(...) else -> activateSoulHarvest(...); return TypedActionResult.success(stack). - Managers: ArenaManager & BossManager — handle ticked scheduling, incremental build/cleanup, boss sequencing, bossbars, custom drops. - All dynamic state & cooldown timestamps stored in DataComponentTypes.CUSTOM_DATA on ItemStacks and/or server-side session/components. - Defensive reads: safe defaults when DataComponents missing. - Update DataComponentTypes.LORE every 20 server ticks server-side; v96/v148 must initialize on first hold and then global 20-tick rebuild across all inventories. SPAWN/PARTICLES/SOUNDS SAFETY - Particle & sound spawns wrapped in try/catch and spawnParticlesSafe. - Throttle loud sounds and cap particle counts per budget. - Replace Thread.sleep with scheduled server tasks; batch arena and dome build into ticked batches. HAUNTED DOME (AUTHORITATIVE CONSOLIDATED BEHAVIOR) - Geometry & build (v60 + v160 + v147 + v161 combined authoritative): - Shell: instant shell build at tick0: x/z range -25..25, y 0..25 (radius ≈25). Build orange/ORANGE_STAINED_GLASS shell INSTANTLY tick0–20 (loop x=-25..25, z=-25..25, y=0..25; place glass where dist between 24.5 and 25.5). - Floor: build floor during tick0–20 with podzol/soul_sand/coarse_dirt/jack_o_lantern distribution: PODZOL 40%, SOUL_SAND 30%, COARSE_DIRT 20%, JACK_O_LANTERN 10%. - Decorations & structures (v161 timings): - Tick0–20: glass + floor. - Tick21–35: spawn 4–7 random structures (unique per-dome; shuffle pool and pick 4–7; place with spacing >=8; avoid center ±6 blocks; 2–3 randomized variants per structure). - Tick36–40: spawn zombies after structures placed. - Decorations overlay: shuffle glassBlocks, pick 70% to cover; overlay probs: COBWEB 30%, JACK_O_LANTERN 25%, SKULL 15%, SOUL_LANTERN 15%, CHAIN 10%, ORANGE_WOOL 5%; 30% remain clear. - Ground transforms: Grass→PODZOL, Dirt→SOUL_SOIL, Stone→BLACKSTONE. - Random structure pool (v161): shuffle with world.random, pick 4–7 unique structures (Graves, Pumpkins, Spooky, Magic, Altars, Graveyard, Campsite, Tree Stump, Pumpkin Patch, Witch Corner, Cage, etc.). Find safe positions with spacing >=8 and avoid center ±6. - Mobs & gear: - Spawn 10 zombies with CARVED_PUMPKIN helmets (Curse of Binding), Copper armor dyed orange, Iron Sword with Fire Aspect II + Sharpness III, Strength II & Speed II effects (infinite), equipment drop chance = 0.0f. - Orange flame foot particles on zombies; custom AI. - v160: zombies spawn ONLY after dome fully built; find solid ground inside dome for each spawn; teleport random hostiles into dome if needed (target range dome radius + 16 = 41). - Team & AI: - Create team "haunted_dome_{ownerUUID}" (color GOLD, friendly fire OFF); add owner + zombies. - Clear zombies' default goals; add custom NearestAttackableTargetGoal targeting HostileEntity not in team and PlayerEntity not owner. - Remove team at dome end. - Lifecycle & timings: - Build: tick0–20 glass+floor; tick21–35 structures; tick36–40 spawn zombies; active ~20s preferred (remove after ~20s). - Destruction sequence: tick0-20 remove decorations top-down spawn SMOKE; tick20-40 remove glass top-down spawn FLAME; tick40 despawn zombies with PORTAL particles and delete team. (v160 cleanup sequencing). - Storage & metadata: - Only store minimal metadata in CUSTOM_DATA: center coords, radius, spawned zombie UUIDs (avoid block lists >100). - v161: store structure positions for cleanup as small list "x,y,z;x,y,z" allowed in CUSTOM_DATA (4–7 entries). - Cooldown: - v161 authoritative: dome_cd = world.getTime() + 1200 (60s) AFTER cleanup. - v147 — CRITICAL Fix 5 (EXACT): Servants must be equipped immediately after spawn via equipDomeServant(zombie). Exact equipment per servant (apply to ALL 10 zombies immediately after spawn): - Head: CARVED_PUMPKIN - Chest/Legs/Boots: COPPER_CHESTPLATE / COPPER_LEGGINGS / COPPER_BOOTS dyed orange - Weapon: IRON_SWORD with Fire Aspect II + Sharpness III - Effects: Strength II (infinite), Speed II (infinite) - Particles: 2 FLAME particles at feet every tick - Glow: ORANGE team color (use Glowing effect + team) - Drop Chances: ALL 0.0f - Application Timing: build glass dome -> teleport entities inside -> spawn 10 zombies in circle (4 blocks from center) -> immediately after each zombie spawn call equipDomeServant(zombie) -> add decorations. SOUL HARVEST - Mechanics: - Server-side forward 10-block forward box/cone dealing 25 damage (preferred); apply GLOWING for 100 ticks; Soul Mark lasts 5s. - Marked-kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count in CUSTOM_DATA. - Cooldown: - harvest_cd = world.getTime() + 10 ticks (0.5s) AFTER use (v148). - Visuals: batched particle arcs; lore updates on kills; orb pickup server-side handling. Integrates with v89 soul progression. SOUL REAPER / WITCH FLIGHT (ALTERNATE) - Soul Reaper: - CD: reaper_cd = 900 ticks (45s). Duration 8s. - Spawn 8 orbiting scythes implemented as invisible no-gravity ArmorStands + NETHERITE_HOE heads rotating at 3-block radius. - Emit SOUL_FIRE_FLAME and periodic AoE damage + Weakness II to nearby enemies. - Scheduled rotation and cleanup server-side (batched). - Witch Flight alternative: - CD 2400 ticks, 15s creative-like flight ×2 speed with SLOW_FALLING on end. PUMPKIN SENTINELS / PUMPKIN SENTRY SYSTEM - v155 FINAL design (pre-v171 modifications): - 8 floating pumpkin sentries (invisible armor stands with JACK_O_LANTERN head). - ArmorStand properties: setInvisible(true); setMarker(true); setInvulnerable(true). Only pumpkin head visible; projectiles pass through armor stands. - Positioning: circle radius 3.5 around player; heights alternate y+1.0,y+1.5,y+2.0 repeating. - Orbit: increment orbitRotation by 1.5° per tick (full rotation 240 ticks = 12s); bobOffset = 0.15 * sin(time * 0.1 + i * 0.5). - Ground circle indicator: SOUL particles under each pumpkin circle every 2 ticks. - Independent target detection: scan within 15 blocks per pumpkin; ignore owner & ArmorStandEntity. - Shooting (pre-v171): per-pumpkin fire every 20 ticks (1s) after target acquired. Projectile = small JACK_O_LANTERN ItemEntity, no gravity, velocity 1.0 block/tick, tag ignore_armor_stands true. Damage on hit = 6.0. Hit effects: 15 ITEM_CRACK, 10 FLAME particles, sound BLOCK_WOOD_BREAK pitch 1.5. - Duration: active 30s (600 ticks). Cleanup: remove armor stands, stop particles/sounds. Cooldown: 45s before reactivation. - All actions server-side; remove existing sentinels before spawning new ones. HALLOWEEN ARENA (v36..v163 authoritative) - Activation: - Hold Y for 100 ticks (5s). Client shows actionbar percent. - v163 ENTRY flow: server receives "reaper:arena_enter" after client holds Y uninterrupted for 100 ticks. Check arena_cd; if world.getTime() < arena_cd → send remaining time and abort. - On success set arena_entry_time = world.getTime(), store origin_x,y,z, total_bosses = random(1..7), bosses_killed=0, add scoreboard tag "in_arena", teleport player to arena spawn, set time/night, schedule first boss spawn at +100 ticks. DO NOT set cooldown on entry. - Structure & protection: - Hollow BARRIER cube 53x53x32 (walls x/z = -26..26, interior x/z = -25..25, y=0..31 interior y=1..30 empty). - Prevent block place/break inside; prevent mob spawning inside except manual bosses; arena blocks indestructible to boss projectiles. - Store arena coordinates and owner UUID server-side (do NOT store full block lists in CUSTOM_DATA). - Interior terrain & build: - v86 randomized interior: base ground y=1→3 mix: 50% PODZOL, 20% SOUL_SAND, 15% COARSE_DIRT, 10% MOSS_BLOCK, 5% MYCELIUM; small hills/dips; thematic corner structures. - Build tick0–40 batched; teleport player to arena center at tick40. - Boss system & timing: - First boss spawns 100 ticks after teleport; subsequent bosses spawn 60 ticks after previous death. - Multi-boss queue random 1–7 bosses per run (v163 total_bosses random 1..7). - Boss positions spawn near arena edge (18–25 blocks). - Jumpscares scheduled every 30–60s per boss (v146). - Loot & collection: - On boss death collect ItemEntity drops within 10 blocks into temporary arenaLoot list and remove ItemEntities (prevent duplication). - At arena end transfer items to player inventory via insertStack(); if inventory full drop remaining near player. - v146: teleport player back to origin BEFORE delivering loot; after teleport wait 1 tick then insert loot; set arena cooldown accordingly. - v158 & v163: If insertStack fails, stash serialized ItemStack in CUSTOM_DATA.pending_loot per player UUID and retry on next login/respawn; fallback to drop at feet. Use DataComponentTypes-based ItemStack serialization and transactional delivered flag reward_delivered. - v163: Reward rules changed: award EXACT ONE reward on exit (if ≥1 boss killed) chosen by Tier computed from bosses_killed: - Tier1 (bosses_killed == 1) choices: 20x Diamond Block; 40x Emerald Block; 5x Netherite Ingot; Enchanted Book (Efficiency15, Fortune10, Unbreaking10). - Tier2 (bosses_killed == 2–3) choices: Hellforged Pickaxe (Netherite, Efficiency15, Fortune10, Unbreaking10, Mending, custom name/lore); Reaper's Cleaver (Netherite Axe, Sharpness20, Looting10, Unbreaking10, Mending, +4 attack); Pumpkin Crown (Jack_O_Lantern helmet, Protection15, Unbreaking10, +10 max health). - Tier3 (bosses_killed >=4) choices: Soul Reaver (Netherite Sword, Sharpness30, Looting10, Unbreaking15, Mending, +6 attack, on-kill Strength II for 10s); Reaper's Visage (Netherite Helmet, Protection25, Unbreaking15, Mending, Thorns5, +10 max health, grants Resistance I while worn); Hammer of the Abyss (Netherite Pickaxe, Efficiency25, Fortune15, Unbreaking15, Mending, tag "mines_3x3"=true); Totem of Tiny Terror (Totem, offhand-only, applies scale 0.25 while in offhand) — set custom tag "reaper_totem". - Implementation: Build ItemStack with DataComponentTypes.ENCHANTMENTS, DataComponentTypes.CUSTOM_NAME, DataComponentTypes.LORE, DataComponentTypes.ATTRIBUTE_MODIFIERS. - On exit set arena_cd = world.getTime() + 4800 (4 minutes) — ONLY on exit. - Cleanup: - On exit/timer end: transfer loot to player, teleport player back to saved overworld pos, remove entities inside arena, batched set interior blocks to AIR, wait 5s then remove BARRIER blocks, clear session data, send “Halloween Arena has been cleared.” - Exit rules (v149 + v163): - Exit ONLY when: - timePassed >= 6000 ticks (5 min) OR - player death at 0 HP while "in_arena" OR - bosses_killed == total_bosses OR - Manual exit: "reaper:arena_exit" after 100-tick hold while "in_arena". - DO NOT exit on health < max or other tick-loop health checks. - Persistence & pending loot: - v158/v163: pending_loot serialized list in CUSTOM_DATA per owner; retry deliver on respawn/login; drop at feet if still fails. reward_delivered flag to prevent duplicates. BOSSES & SEQUENCING - Seven modular bosses: Pumpkin King (~400HP), Headless Horseman (~450), Witch Queen (~350), Spectral Reaper (~500), Candy Golem (~600), Soul Warden (~700), Corrupted Mage (~400) — HP configurable. - Store active boss UUID in reaper:active_boss_uuid and spawned entity UUIDs in reaper:spawned_entities (UUIDs only). Tag bosses "arena_boss". Use reaper:drops_handled to prevent duplicate loot handling. - Jumpscare super-attacks (v146): per-boss, cooldown 20s, must exist 10+s before first use; track last_jumpscare_time in boss entity NBT; unique behaviors defined. - v160 Headless Horseman: implement as single HostileEntity (no mount originally), ChargeAttackGoal, MeleeAttackGoal, ActiveTargetGoal, tick() trail every 5 ticks, equip NETHERITE_SWORD with FIRE_ASPECT 3 & SHARPNESS 5, GENERIC_ATTACK_DAMAGE base 12.0 for dome zombies specifics. - v163: Boss soul credit mapping on boss death by player using Reaper's weapon — add souls to weapon CUSTOM_DATA soul_count persistently: - PumpkinKing +50 - WitchQueen +60 - HeadlessHorseman +70 - SpectralReaper +80 - CorruptedMage +90 - SoulWarden +100 - CandyGolem +150 SOUL PROGRESSION & DAMAGE SCALING - v89: soul_count +1 per mob kill with this weapon; persistent on item. - Damage Bonus: Every 50 souls = +1 Attack Damage (max +50). Store "damage_tier" in CUSTOM_DATA; apply via AttributeModifiersComponent or server-side pattern. - Tier-up notifications: ENTITY_PLAYER_LEVELUP sound (pitch 1.5 vol 1.0), 50x SOUL_FIRE_FLAME particles, Title 5s. - Kill detection: server-side entity death event; if player killed with ReapersHarvestItem call incrementSouls(heldItem), checkTierUp, displaySoulProgress. SOUL HARVEST ORB EFFECTS - Marked kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count. Orb pickup handled server-side and updates lore/actionbar. LOOT & RARITY - v163 overrides: ONE reward on exit if bosses_killed >=1 (Tier1/2/3 mapping above). - Use DataComponentTypes for item construction (ENCHANTMENTS, CUSTOM_NAME, LORE, ATTRIBUTE_MODIFIERS). Totem special tag "reaper_totem". - v158 persistence: pending_loot fallback via CUSTOM_DATA.pending_loot per player UUID and delivered flag. DATA SIZE MANDATES (v54 CRITICAL) - MUST NOT store huge block-pos lists in CUSTOM_DATA (>50k or >100 items). For cleanup store centers/radii only; recompute blocks or keep server-side lists. - Small structure position lists (4–7) allowed for dome cleanup (v161). CRASH & NPE / SAFE PATTERNS - ServerWorld validation for particle spawning; defensive null-checks; try/catch around particle/sound spawns; replace Thread.sleep with scheduled server tasks; implement spawnParticlesSafe; batch arena build into 60 batches; teleport only after build completes. IMPLEMENTER CHECKLIST (actionable) 1) Client keybinds & client packet sending only when main-hand holds item; server GlobalReceiver validate ownership. 2) ReapersHarvestItem extends SwordItem; stats: Attack 35, AttackSpeed -2.4f; hasGlint=false; Netherite ToolMaterial. 3) use(): server-only branch to call activateHauntedDome when sneaking else activateSoulHarvest; return TypedActionResult.success(stack). 4) All dynamic state & cooldowns in DataComponentTypes.CUSTOM_DATA; lore updated server-side every 20 ticks using Text.literal().styled(.withItalic(false)). 5) Cooldowns read/written with world.getTime(); keys as listed above. 6) Haunted Dome: follow v60 behavior (radius 25 shell, decoration algorithm, spawn 10 zombies, team, 40-tick destruction, minimal metadata stored). Apply v147 equipDomeServant() immediately after spawn and v160/v161 timing and structure pool. 7) Soul Harvest: server-side forward area, glowing 100 ticks, orb grants +2 Absorption (cap +10), increments soul_count. 8) Soul Reaper: 8 orbiting armor stands for ~8s (CD 900) with AoE damage + Weakness II, scheduled rotation/cleanup. 9) Halloween Arena: Hold Y 100 ticks; v85 BARRIER cube; randomized interior; tick0–40 build; teleport tick40; first boss 100 ticks after teleport; collect boss drops into arenaLoot; transfer to player via insertStack() at end; pending_loot fallback. 10) BossManager: implement 7 bosses with unique equipment/AI/jumpscares; store active boss UUIDs; handle drops via reaper:drops_handled. 11) Pumpkin Sentinels pre-v171: per v155 behavior; will be replaced by v171 rules below. 12) Particle/sound budgets; spawnParticlesSafe wrapper; try/catch; batch heavy operations across ticks. 13) Testing & polish: ensure no NPEs; safe registry lookups; no oversized CUSTOM_DATA; lore/actionbar correctness; particle & sound caps; boss AI & loot correctness. 14) Haunted Dome uniqueness (v161): implement structure pool shuffle, pick 4–7, find safe positions with spacing >=8, build variants, store small positions string "x,y,z;x,y,z" in CUSTOM_DATA for cleanup; ensure zombies avoid structures. ARENA (v163) DETAILED SERVER FLOW & CUSTOM_DATA KEYS - REQUIRED WEAPON CUSTOM_DATA KEYS: - arena_entry_time (long) - origin_x,y,z (double) - total_bosses (int) - bosses_killed (int) - soul_count (int) - pending_loot (serialized list) - arena_cd (long) - reward_delivered (boolean) - arena_death_pending (boolean) - ENTRY (Hold Y 5s): - Server receives "reaper:arena_enter". If world.getTime() < arena_cd → send remaining time and abort. - On success: set arena_entry_time, store origin coords, total_bosses=random(1..7), bosses_killed=0, add "in_arena" tag, teleport player to arena spawn, schedule first boss at +100 ticks. DO NOT set cooldown here. - MANUAL EXIT (Hold Y 5s inside): - Server receives "reaper:arena_exit" after 100-tick hold while player has "in_arena". Call exitArena(player,"MANUAL"). - TIMER: - Server tick loop: if player has "in_arena" check world.getTime() - arena_entry_time >= 6000 → exitArena(player,"TIMEOUT"). - DEATH: - PlayerDeathEvent: if player had "in_arena": mark pending loot into pending_loot, set arena_death_pending in CUSTOM_DATA, remove "in_arena", schedule cleanup; on respawn teleport to origin then server.execute after 1 tick to attempt deliver pending_loot. - exitArena(player, reason): - Remove "in_arena". - Compute reward tier from bosses_killed: 0 none, 1 Tier1, 2–3 Tier2, ≥4 Tier3. - Build EXACT ONE ItemStack server-side from specified tier list (use DataComponentTypes APIs). Teleport player to origin, then server.execute(() -> try insertStack(item); if false add to pending_loot). - Set arena_cd = world.getTime() + 4800 (4 minutes) — ONLY on exit. - Persist reward_delivered true and save pending_loot if any. - Clean arena entities/blocks. - Reward delivery: teleport-before-deliver; 1-tick delay to insert; if insert fails add to CUSTOM_DATA.pending_loot for retry on respawn/login. VERSION HIGHLIGHTS & EVOLUTION (chronological; each line = important changes) - v1: Original: Reaper’s Harvest, Haunted Dome, Soul Harvest, Witch Flight, souls progression, boss ideas. - v2: Added Halloween Arena & boss system. - v5: Fixes: hasGlint=false, extend SwordItem, Netherite, keybinds, use(), cooldown storage DataComponents. - v6: Combat & dome specifics set. - v8: Consolidation: controls, abilities, cooldowns, lore every 20 ticks. - v10–v13: Cooldown system; Flight→Soul Reaper (v13). - v28–v31: Stability & polish: DataComponents-only, dome crash checks, arena terrain, 7 bosses, particle/perf caps. - v35: Dome stabilization; spawn 10 zombies, transforms, batched build, active 20s. - v36: Arena 53x53x32 BARRIER cube; staged batching. - v37: Boss sequencing: 7 modular bosses. - v42, v48, v53: NPE & particle crash fixes; spawnParticlesSafe. - v54 (CRITICAL): DATA SIZE LIMIT FIX — MUST NOT store block lists in CUSTOM_DATA. - v58: Arena build batching & teleport after build complete. - v59: Halloween sound mappings & cooldown examples. - v60: Haunted Dome REWORK: instant shell radius ≈25, decoration algorithms, team mechanics, destruction sequence, zombie gear/AI. - v72: Lore & cooldown UI finalization. - v82: Lore smoothing, dome stabilization, registry safe lookups. - v85: ARENA - STRUCTURE & PROTECTION. - v86: ARENA - RANDOM TERRAIN. - v87: ARENA - TELEPORT, BOSS SPAWN, LOOT. - v88: ARENA - CLEANUP & RESET. - v89: Complete Lore & Soul Progression template. - v91: Arena Loot & Rarity System. - v93: ARENA - COMPLETE BOSS SYSTEM. - v94: ARENA - ONE-TRY SYSTEM: global lore rebuild every 20 ticks; teleport/loot ordering. - v96: Dynamic Lore System & Boss Equipment details. - v146: CRITICAL FIXES — Boss jumpscare super-attacks + Loot Distribution (pending_arena_loot, teleport-before-deliver). - v147: CRITICAL Fix 5 — Dome Servant Equipment exact specs; equipDomeServant() immediately after spawn. - v148: LORE & COOLDOWN SYSTEM - COMPLETE FIX — 20-tick global lore rebuild; independent cooldowns; initialize cooldowns to 0. - v149: ARENA INSTANT DEFEAT FIX — exit only on timeout, death, or victory. - v151–v155: PUMPKIN SENTINELS initial + reworks; v155 final sentinels (pre-v171). - v154: ARENA REWARD & BOSS EQUIPMENT REWORK. - v158: Rebuild Arena Loot System for Fabric 1.21.5 — DataComponent persistent pending_loot fallback. - v160: Dome and Horseman Fixes: dome build speed, zombie spawn timing, extended target range, HeadlessHorseman fixes. - v161: HAUNTED DOME - RANDOM STRUCTURES; dome_cd = +1200 after cleanup; timings: Tick0–20 glass+floor; Tick21–35 4–7 structures; Tick36–40 spawn zombies; store small structure pos list. - v163: ARENA & LOOT update: - Hold-Y entry/exit, EXACT ONE reward on exit (if ≥1 boss killed), persist pending_loot, credit souls on boss death. New CUSTOM_DATA keys listed in arena section. Entry/exit/timer/death/teleport-before-deliver rules clarified. - v171 (TARGET & NEW REQUIREMENTS): - TARGET: Fabric 1.21.5 mod generator. Produce compact, safe server-side code to implement changes below. Use DataComponents for persistent item data. Avoid huge particle bursts, validate chunks, and schedule repeating tasks rather than blocking the server thread. - GOAL: Replace sentinel projectiles with ArmorStand projectiles; polish boss visuals; rewrite Horseman mount; keep everything performant and robust. - Sentinels → ArmorStand projectiles: - Sentinels: spawn 8 sentinels orbiting player radius 3.5, heights alternate 1.0/1.5/2.0; angular speed ≈1.5°/tick; bob y+=sin(worldTime*0.1 + i*0.5)*0.15. - Targeting scan: every 10 ticks each sentinel scans within 15 blocks for nearest hostile or non-owner player; store target UUID on sentinel persistent DataComponents. - Charge sequence: when target acquired, play 15-tick charge (small spiral of 15 FLAMEs), play BLOCK_FIRE_AMBIENT. - Fire cadence: each sentinel fires every 25 ticks. Fire spawns an ArmorStand projectile with persistent DataComponents: invisible, marker, noGravity, small, tag "pumpkin_projectile", store vx,vy,vz and lifetime. velocity = normalize(targetPos - headPos) * 1.2. - Projectile tick: move projectile by velocity; increment lifetime; trail low-rate particles (cap e.g. 5 FLAME, 3 SMOKE, 2 SOUL_FIRE per tick across all projectiles); collision check within 0.5 block excluding owner & sentinels. On hit: entity.damage(DamageSource.magic(), 6.0f), spawn moderate particles, play ENTITY_GENERIC_EXPLODE and BLOCK_FIRE_EXTINGUISH, small knockback, remove projectile. Timeout >60 ticks → spawn 10 SMOKE, play extinguish, remove projectile. - Animations: sentinel tilts 15° for 5 ticks when firing. - Cap particle counts and spread across ticks. Use spawnParticlesSafe and try/catch. Store per-projectile state in DataComponents. Use schedulers: 2-tick sentinel motion, per-tick projectile updates, 10-tick targeting. - Boss polish (v171): - Corrupted Mage: equip helmet = PURPLE_WOOL ItemStack; setEquipmentDropChance HEAD = 0; entity.setGlowing(true). - Soul Warden: Helmet = LAPIS_BLOCK; Chest/Legs/Boots = LEATHER dyed navy (0x191970); drop chances 0.0; glowing true. - Candy Golem: Helmet = IRON_BLOCK; Leather armor dyed pink (0xFFC0CB); drop chances 0.0; glowing true. On Candy Golem death: add +5 to bosses_killed in weapon DataComponents (counts as 5). - Horseman (robust mount rewrite): - Spawn SkeletonHorseEntity: setTamed(true), setAiDisabled(true), setInvulnerable(true), silent, tag "arena_horseman_mount" and "no_block_break". - Spawn WitherSkeleton rider; equip WITHER_SKELETON_SKULL; set drop chance 0; tag "arena_horseman_rider". - world.spawnEntity(horse), world.spawnEntity(rider); rider.startRiding(horse,true). - Schedule repeating controller task: ensure rider mounted; find nearest target ≤25 blocks; compute direction; movement = direction * 0.12; ensure not to fall by checking ground under newPos; setPosition(newPos) and yaw; if dead discard both. - Prevent block break by canceling BlockBreak events for entities with tags above. - Safety & Performance: - Always check chunk loaded before setBlock/setEntity or schedule operation. - Use scheduler for repeating tasks (2-tick sentinel motion, per-tick projectile updates, 10-tick targeting). - Cap per-tick particles and spread across ticks. - Use DataComponents for storing per-entity/projectile persistent values. - Validation checklist (v171): Sentinels spawn/orbit/tilt/charge/fire ArmorStand projectiles; projectiles deal 6 damage and remove on collision/timeout; boss equip changes; Candy Golem death increments bosses_killed by 5; Horseman mount spawn & movement controlled; no huge single-tick particles; chunk checks; scheduled tasks only. - Deliverable (v171): Provide server-side Java code snippets for: - spawn handlers (sentinels and boss equipment), - sentinel scheduler (orbit motion, targeting every 10 ticks, charge effect), - ArmorStand projectile lifecycle (spawn, tick movement, collision, timeout using DataComponents), - boss spawn adjustments (Corrupted Mage, Soul Warden, Candy Golem equip + death special), - horseman controller (mount spawn, rider spawn, repeating movement task, block-break prevention tags), - event listeners to cancel block breaking for tagged entities/mounts, - brief note on required hooks: server tick scheduler registration, entity spawn hooks, block/chunk checks, event cancellations. - Code requirements: compact, safe, server-side, Fabric 1.21.5-compatible; use DataComponents; validate chunks & schedule tasks; use spawnParticlesSafe; comments where to wire into existing managers. v172 EDIT (ADDITIONAL TARGETS & NEW REQUIREMENTS) - TARGET: Fabric 1.21.5 server-side generator. Rework boss damage scaling & loot-safety system. MUST use DataComponentTypes (NO raw NBT). Return compact Java-ready pseudocode + DataComponent calls. Keep server-side scheduled tasks, non-blocking, chunk-checked, particle-budgeted. - GOALS: 1. getPlayerProtectionLevel(player): sum Protection enchant levels on HEAD/CHEST/LEGS/FEET using DataComponentTypes.ENCHANTMENTS. 2. Per-boss damage formulas: safe base, multiplier, minimum. Apply via entity.damage(DamageSource.mob(boss), damage). 3. Clamp Resistance from loot to <= III; replace excessive Resistance with Regeneration/Absorption/+maxHealth as fallback. 4. Soul Reaver on-kill Strength buff: 5s duration, 30s cooldown tracked on item via DataComponentTypes.CUSTOM_DATA key "soul_reaver_last_strength". 5. All enchantments, names, lore and attributes set through DataComponentTypes APIs. - CORE FUNCTIONS (pseudocode): - getPlayerProtectionLevel(ServerPlayerEntity p): iterate EquipmentSlot HEAD/ CHEST/ LEGS/ FEET, read DataComponentTypes.ENCHANTMENTS map, sum Protection enchant levels safely. - calcDamage(float BASE, float MULT, float MIN, int prot): damage = BASE - (prot * MULT); return max(damage, MIN). - Boss schedule pattern: scheduleRepeating(intervalTicks, () -> { if (!boss.isAlive()) cancel(); LivingEntity t = findNearestValidTarget(boss, range); if (t==null) return; int prot = getPlayerProtectionLevel((ServerPlayerEntity) t); float dmg = calcDamage(BASE,MULT,MIN,prot); t.damage(DamageSource.mob(boss), dmg); spawnLimitedParticles(...); }); - BOSS FORMULAS / INTERVALS (constants recommended): - PumpkinKing: BASE=8f, MULT=0.15f, MIN=1f, INTERVAL=30 - WitchQueen: BASE=6f total poison, MULT=0.12f, MIN=0.5f, apply poison over 5s - HeadlessHorseman: BASE=10f, MULT=0.18f, MIN=1.5f, INTERVAL=40 - SpectralReaper: BASE=12f, MULT=0.22f, MIN=2f, AOE radius=4, INTERVAL=50 - CorruptedMage: BASE=9f, effectiveProt=prot*0.7, dmg=max(BASE - effectiveProt*0.15f,1.5f), INTERVAL=25 - SoulWarden: BASE=11f, MULT=0.20f, MIN=2f, INTERVAL=35, boss.heal(2.0f) on hit - CandyGolem: BASE=14f, MULT=0.25f, MIN=1f, melee; apply Slowness II for 60 ticks - SOUL REAVER KILL BUFF (pseudocode): - onEntityDeath(event) { if (killer.holds("Soul Reaver")) { ItemStack s = killer.getMainHandStack(); long last = s.get(DataComponentTypes.CUSTOM_DATA).getLong("soul_reaver_last_strength",0L); if (world.getTime() - last >= 600) { killer.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH,100,1)); s.get(DataComponentTypes.CUSTOM_DATA).putLong("soul_reaver_last_strength", world.getTime()); spawnLimitedParticles(killer.getPos(),30); } } } - LOOT & RESISTANCE GUARD: - applyLootSafety(ItemStack item): if item grants Resistance > 3 clamp to III and duration <= configured cap; if originally permanent/excessive replace with Regeneration I or Absorption/+maxHealth. Clamp enchantment levels with helper; set lore/name via DataComponentTypes. - HELPERS: - safeGetEnchantmentLevel(enchMap, ench): return level or 0. - clampEnchantLevels(item,...) - spawnLimitedParticles(pos, maxParticles): batch/throttle; reduce if many players present. - chunkLoadedCheck(pos) before teleport/block ops. - PERFORMANCE & SAFETY: - All repeating tasks via server scheduler; cancel when entity dead or chunk unloaded. - Particle budget per-event <=200; ambient <=50. - Validate chunk loaded and permissions before block edits. - Do NOT use raw NBT; use DataComponentTypes.CUSTOM_DATA, ENCHANTMENTS, LORE, ATTRIBUTE_MODIFIERS. - VALIDATION CHECKLIST (v172): - getPlayerProtectionLevel uses DataComponentTypes.ENCHANTMENTS. - Each boss damage formula applied at right cadence. - Candy Golem applies Slowness and adjusted damage; Candy death increments bosses_killed by 5 (v171). - Soul Reaver cooldown tracked via CUSTOM_DATA "soul_reaver_last_strength" and enforced (30s). - Loot items never give Resistance > III; excessive effects clamped/replaced. - All data writes use DataComponentTypes. - DELIVERABLE (v172): Return Java-like code snippets implementing helpers and constants (pseudocode acceptable), using DataComponentTypes API calls, scheduled non-blocking server tasks, chunk validations, spawnParticlesSafe usage, and concise testable logic. FINAL ENFORCEMENT (authoritative) - Fabric 1.21.5-compatible server-side code. - All data persisted via DataComponentTypes (CUSTOM_DATA, LORE, ENCHANTMENTS, ATTRIBUTE_MODIFIERS); NO raw NBT. - spawnParticlesSafe wrapper & try/catch for particle/sound spawns. - Heavy tasks scheduled on server tick scheduler (server.execute) with batched edits. - Update lore exactly every 20 server ticks using Text.literal().styled(.withItalic(false)); global rebuild across all inventories. - Haunted Dome per v60/v147/v160/v161, HeadlessHorseman per v160, Soul Harvest/Reaper/Witch Flight per specs, Pumpkin Sentinels per v171 armor-stand-projectile model, Halloween Arena full lifecycle per v85..v163, BossManager (7 bosses) per damage formulas (v172). - Cooldowns follow v148 independent-key rules, except overrides specified (dome_cd v161, arena_cd set ON EXIT v163). - Arena exit rules exactly per v149/v163; teleport-before-deliver and pending_loot fallback per v146/v158/v163. - Robust fallbacks for reward delivery (pending_loot) and idempotent reward_delivered flag. - Implement logging and validation for chunk loads/teleports; avoid NPEs. SUMMARY OUTPUT REQUIREMENTS (from edits v171 & v172) - Provide compact, safe server-side Java-like pseudocode/snippets for: - spawn handlers and scheduler wires for sentinels (orbit, targeting, charge, fire) using ArmorStand projectiles stored via DataComponents, - projectile lifecycle (tick movement, collision, timeout), - boss equipment adjustments (Corrupted Mage, Soul Warden, Candy Golem) and Candy death behavior (+5 bosses_killed), - Horseman mount rewrite (spawn horse + rider, controller task, block-break prevention tags), - helper functions: spawnParticlesSafe, getPlayerProtectionLevel (DataComponents.ENCHANTMENTS), calcDamage, applyLootSafety, clampEnchantLevels, - scheduler patterns (repeat task registration, cancellation on death/chunk unload), - event listeners for block break prevention and PlayerDeath/Respawn reward delivery, - where to wire into ArenaManager, BossManager, ReapersHarvestItem flows (comments). - All code must validate chunks, use schedulers instead of blocking, respect particle budgets, use DataComponentTypes for persistent state, and be tested for NPE/CRASH safety. END — Complete authoritative, machine-actionable summary combining original request + every edit through v171 and v172. Edit v175: # FIX PART 1: Horseman Spawn Fix ## CRITICAL FIX: HORSEMAN SINGLE ENTITY **Problem**: Horseman doesn't spawn, mounting too complex. **Solution**: Spawn as single Wither Skeleton with particle horse beneath. ``` Method: spawnHeadlessHorseman(ServerWorld world, Vec3d pos) // Spawn Wither Skeleton WitherSkeletonEntity horseman = EntityType.WITHER_SKELETON.create(world) horseman.refreshPositionAndAngles(pos.x, pos.y, pos.z, 0, 0) // Equipment ItemStack skull = new ItemStack(Blocks.WITHER_SKELETON_SKULL) horseman.equipStack(EquipmentSlot.HEAD, skull) horseman.setEquipmentDropChance(EquipmentSlot.HEAD, 0.0f) // Tags horseman.addScoreboardTag("arena_boss") horseman.addScoreboardTag("headless_horseman") horseman.setCustomName(Text.literal("§c§lHeadless Horseman")) // Stats horseman.getAttributeInstance(EntityAttributes.GENERIC_MAX_HEALTH).setBaseValue(450.0) horseman.setHealth(450.0f) horseman.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(0.35) // Prevent block breaking Override canModifyAt method: return false world.spawnEntity(horseman) // Particle horse (task every 2 ticks) Schedule repeating while horseman.isAlive(): Vec3d pos = horseman.getPos() // Horse body outline (12 points circle) For i = 0 to 11: double angle = (i / 12.0) * Math.PI * 2 double x = pos.x + Math.cos(angle) * 0.6 double z = pos.z + Math.sin(angle) * 0.6 world.spawnParticles(ParticleTypes.SMOKE, x, pos.y - 0.5, z, 1, 0, 0, 0, 0) // 4 leg positions with SOUL particles double[][] legs = {{0.3, -0.8, 0.3}, {-0.3, -0.8, 0.3}, {0.3, -0.8, -0.3}, {-0.3, -0.8, -0.3}} For each leg: world.spawnParticles(ParticleTypes.SOUL, pos.x + leg[0], pos.y + leg[1], pos.z + leg[2], 2, 0.1, 0, 0.1, 0) // Gallop sound every 20 ticks if (world.getTime() % 20 == 0): world.playSound(null, pos, SoundEvents.ENTITY_HORSE_GALLOP, SoundCategory.HOSTILE, 0.5f, 0.8f) ``` **Result**: Horseman spawns reliably as single entity with visual horse effect, cannot break blocks, moves faster than normal skeleton.
1
Nov 1, 2025, 07:04 PM
User request: Reaper’s Harvest (Fabric 1.21.5) — authoritative developer spec + full edit history (original → v171). Contains original request + ALL edits through v163 and v171. Machine-actionable summary for implementation. CORE ITEM - Class: ReapersHarvestItem extends SwordItem. - Stats: Attack = 35; AttackSpeed = -2.4f; hasGlint() -> false. - ToolMaterial: Netherite. - All abilities server-authoritative. DATA STORAGE RULES (MANDATORY) - All dynamic/item state MUST use DataComponentTypes.CUSTOM_DATA (ONLY small primitives) & DataComponentTypes.LORE. - NEVER store large collections (>100 items) or block-position arrays in CUSTOM_DATA (v54 CRITICAL). - Allowed CUSTOM_DATA primitives (ONLY): small ints/longs/bools and minimal coords/UUIDs: arena_center coords, dome_center coords, radii, cooldown_end timestamps (world.getTime()), soul_count, damage_tier, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities (UUIDs only), reaper:drops_handled. - Treat missing keys as defaults (0). - Small lists of structure positions for a single dome (4–7) permitted (v161) — still respect v54 limits. - Use DataComponentTypes for enchantments, custom name, lore, attribute modifiers; do NOT write raw NBT. THREADING, SCHEDULING & SAFETY - Server-authoritative. Schedule heavy ops via server.execute or server tick scheduler. NEVER Thread.sleep. - Spread heavy ops across ticks; validate ServerWorld & chunk loading. - Defensive null checks; try/catch around particle/sound spawns. - Batch edits and particle bursts. - Implement spawnParticlesSafe(World, ParticleEffect, ...) wrapper: validate ServerWorld & !world.isClient, try/catch, cap and batch particles. Throttle loud sounds. - Log failures, validate chunks loaded before teleport/build. PARTICLE BUDGETS & THEME - Theme: jack-o’-lantern blade, purple ethereal mist, orange/black palette, constant purple particles/whispers. - Use vanilla sounds only (pitch/volume tweaks allowed). Dramatic particles and bossbars. - Particle budgets & recommended batching: - Haunted Dome ~15,000 SOUL_FIRE_FLAME over ~5s batched (v58 may cap ~3000 per event). - Soul Harvest 500 batched. - Soul Reaper pumpkins 40/tick. - Boss spawn 5,000 split across ticks. - Arena ambient 50 SOUL + 20 ASH per second. CONTROLS, UX & NETWORKING - Inputs: - Left Click = normal attack. - Right Click = Soul Harvest (use() override). - Shift + Right Click = Haunted Dome (use() override). - F Key = Soul Reaper (client KeyBinding mapped to FLIGHT_KEY). - Witch Flight = optional alternative to Soul Reaper. - Hold Y for 5s (100 ticks) = Halloween Arena mapped to ARENA_KEY. - Client: register Flight (F) & Arena (Y) KeyBindings in ClientModInitializer via KeyBindingHelper. ClientTickEvents.END_CLIENT_TICK handle keypress/hold and send packets only when main hand holds Reaper’s Harvest. - Networking Packet IDs: - "reaper:flight" - "reaper:arena" (legacy) - v163 explicit: "reaper:arena_enter" and "reaper:arena_exit" - Client sends FlightPayload/ArenaPayload only when main-hand holds item. Server registers GlobalReceiver; on receive validate player/world/item ownership; server.execute schedule work. Packet handlers validate ownership and schedule rather than run heavy inline work. STANDARDIZED KEYS & COOLDOWN RULES (LATEST AUTHORITATIVE) - Standard keys: harvest_cd, dome_cd, reaper_cd (aka flight_cd), arena_cd; arena/session & boss keys: reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities, reaper:drops_handled; arena origin/center coords, session owner UUID, soul_count, damage_tier. - Use world.getTime() for timestamps; display READY/COOLDOWN/ACTIVE in lore/actionbar. - Independent cooldown rules (v148 finalizing, overridden where specified): - Each ability reads/writes ONLY its own cooldown key. - Harvest: set harvest_cd = world.getTime() + 10 (0.5s) AFTER use. - Haunted Dome: authoritative v161: set dome_cd = world.getTime() + 1200 (60s) AFTER cleanup (v148 previously set 600 — overridden). - Soul Reaper: set reaper_cd = world.getTime() + 900 AFTER use. - Arena: DO NOT set cooldown on entry; set arena_cd = world.getTime() + 4800 (4min) ON EXIT only. - Initialize cooldowns to 0 on item creation (v148 FIX 4). - Cooldown check pattern: compare world.getTime() vs cooldownEnd; if active show cooldown message; only write the relevant key when activating. LORE & UI (SERVER AUTHORITATIVE; EXACT TEMPLATE) - DataComponentTypes.LORE updated every 20 server ticks server-side using Text.literal().styled(s->s.withItalic(false)). v72/v82 atomic lore update; v94/v148 global refresh. - EVERY 20 TICKS scan all online players' inventories and rebuild lore from zero for every Reaper’s Harvest instance (v148/v154/v155 enforcement). - Status icons (formatting exactness required): - READY: " §a§l✔ READY" - COOLDOWN: " §c§l⏳ M:SS" (v96: " §c§l⏳ {m}m {s}s") - ACTIVE: " §e§l⚡ ACTIVE" - Actionbar: hold‑Y progress percent, cooldowns and messages. Soul progress actionbar when collecting souls (v89). - EXACT LORE TEMPLATE (v89/v96 literal — MUST BE APPLIED VERBATIM server-side every 20 ticks using Text.literal().styled(.withItalic(false))): §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ REAPER'S HARVEST ⚔ §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ §7Damage: §f§l35 §8┃ §d§l✦ §7Souls: §5§l{soul_count} §6§l▬▬▬▬ §5§lCURSED POWERS §6§l▬▬▬▬ §6§l◈ Soul Harvest §8§o(Right Click) §7Reap the souls of your enemies §7in a deadly sweeping arc {cooldown_status} §d§l◆ Haunted Dome §8§o(Shift + Right Click) §7Summon a cursed glass prison §7with 10 pumpkin servants {cooldown_status} §5§l✦ Soul Reaper §8§o(Press F) §7Unleash 8 orbiting spectral §7scythes of pure nightmare {cooldown_status} §c§l☠ Halloween Arena §8§o(Hold Y - 5 sec) §7Enter the eternal battleground §7and face the Seven Horrors {cooldown_status} §8§l▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §6§o Halloween Edition By §f§lklow (Replace {cooldown_status} and {soul_count} dynamically; ready/cooldown/active strings must use specified formatting.) CORE CLASSES & METHODS (REQUIRED) - ReapersHarvestItem extends SwordItem: implement use(); activateHauntedDome(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulHarvest(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulReaper(...) / activateWitchFlight(...); activateArena(ServerWorld, ServerPlayerEntity, ItemStack). - Managers: ArenaManager & BossManager — handle ticked scheduling, incremental build/cleanup, boss sequencing, bossbars, custom drops. - All dynamic state & cooldown timestamps stored in DataComponentTypes.CUSTOM_DATA on ItemStacks and/or server-side session/components. - Defensive reads: safe defaults when DataComponents missing. - use(): server-only behavior: if user.isSneaking() -> activateHauntedDome(...) else -> activateSoulHarvest(...); return TypedActionResult.success(stack). - Update DataComponentTypes.LORE every 20 server ticks server-side; v96/v148 must initialize on first hold and then global 20-tick rebuild across all inventories. SPAWN/PARTICLES/SOUNDS SAFETY - Particle & sound spawns wrapped in try/catch and spawnParticlesSafe. - Throttle loud sounds and cap particle counts per budget. - Replace Thread.sleep with scheduled server tasks; batch arena and dome build into ticked batches. HAUNTED DOME (CONSOLIDATED; AUTHORITATIVE BEHAVIOR) - Geometry & build (v60 + v160 + v147 + v161 combined authoritative): - Shell: instant shell build at tick 0: x/z range -25..25, y 0..25 (radius ≈25). Build orange/ORANGE_STAINED_GLASS shell INSTANTLY tick0–20 (loop x=-25..25, z=-25..25, y=0..25; place glass where dist between 24.5 and 25.5). - Floor: build floor during tick0–20 (podzol/soul_sand/coarse_dirt/jack_o_lantern distribution: PODZOL 40%, SOUL_SAND 30%, COARSE_DIRT 20%, JACK_O_LANTERN 10%). - Decorations & random structures: - Timing authoritative (v161): Tick0–20: glass + floor; Tick21–35: spawn 4–7 random structures (unique per-dome; shuffle pool and pick 4–7; place with spacing, avoid center ±6 blocks; 2–3 randomized variants per structure). Tick36–40: spawn zombies after structures placed. - Decorations overlay algorithm (when not using full structures): shuffle glassBlocks, pick 70% to cover; overlay probs: COBWEB 30%, JACK_O_LANTERN 25%, SKULL 15%, SOUL_LANTERN 15%, CHAIN 10%, ORANGE_WOOL 5%; 30% remain clear. - DO NOT gradually build glass shell beyond tick0–20; decorations tick20–40; zombies spawn tick36–40. - Transformations: JACK_O_LANTERN, COBWEB, SOUL_LANTERN, WITHER_SKELETON_SKULL; ground transforms: Grass→PODZOL, Dirt→SOUL_SOIL, Stone→BLACKSTONE. - Random structure pool (v161): shuffle with world.random, pick 4–7 unique structures from pool (Graves, Pumpkins, Spooky, Magic, Altars, Graveyard, Campsite, Tree Stump, Pumpkin Patch, Witch Corner, Cage, etc.). Find safe positions with spacing >=8, avoid center ±6, build variants. - Mobs & gear: - Spawn 10 zombies with CARVED_PUMPKIN helmets (Curse of Binding), Copper armor dyed orange, Iron Sword with Fire Aspect II (+ Sharpness III per v147 exact), Strength II & Speed II; equipment drop chance = 0.0f. - Orange flame foot particles on zombies; custom AI. - v160: zombies spawn ONLY after dome fully built; find solid ground inside dome for each spawn; teleport random hostiles into dome if needed (target range dome radius + 16 = 41). - Team & AI: - Create team "haunted_dome_{ownerUUID}" (color GOLD, friendly fire OFF); add owner + zombies. - Clear zombies' default goals; add custom NearestAttackableTargetGoal targeting HostileEntity not in team and PlayerEntity not owner. - Remove team at dome end. - Lifecycle & timings: - Build: tick0–20 glass+floor; tick21–35 structures; tick36–40 spawn zombies; active ~20s preferred (remove after ~20s). - Destruction sequence: tick0-20 remove decorations top-down spawn SMOKE; tick20-40 remove glass top-down spawn FLAME; tick40 despawn zombies with PORTAL particles and delete team. (v160 refined cleanup sequencing). - Storage & metadata: - Only store minimal metadata in CUSTOM_DATA: center coords, radius, spawned zombie UUIDs (avoid block lists >100). - v161: store structure positions for cleanup as small list "x,y,z;x,y,z" allowed in CUSTOM_DATA (4–7 entries). - Recompute deterministic cleanup; incremental batched edits. - Cooldown: - v161 authoritative: dome_cd = world.getTime() + 1200 (60s) AFTER cleanup. - v147 — CRITICAL Fix 5 (EXACT): Servants must be equipped immediately after spawn via equipDomeServant(zombie). Exact equipment per servant (apply to ALL 10 zombies immediately): - Head: CARVED_PUMPKIN - Chest/Legs/Boots: COPPER_CHESTPLATE / COPPER_LEGGINGS / COPPER_BOOTS dyed orange - Weapon: IRON_SWORD with Fire Aspect II + Sharpness III - Effects: Strength II (infinite), Speed II (infinite) - Particles: 2 FLAME particles at feet every tick - Glow: ORANGE team color (use Glowing effect + team) - Drop Chances: ALL 0.0f - Application Timing: build glass dome -> teleport entities inside -> spawn 10 zombies in circle (4 blocks from center) -> immediately after each zombie spawn call equipDomeServant(zombie) -> add decorations. SOUL HARVEST - Mechanics: - Server-side forward 10-block forward box/cone dealing 25 damage (preferred); apply GLOWING for 100 ticks; Soul Mark lasts 5s. - Marked-kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count in CUSTOM_DATA. - Cooldown: - harvest_cd = world.getTime() + 10 ticks (0.5s) after use (v148). - Visuals: batched particle arcs; lore updates on kills; orb pickup server-side handling. Integrates with v89 soul progression. SOUL REAPER / WITCH FLIGHT (ALTERNATE) - Soul Reaper: - CD: reaper_cd = 900 ticks (45s). Duration 8s. - Spawn 8 orbiting scythes implemented as invisible no-gravity ArmorStands + NETHERITE_HOE heads rotating at 3-block radius. - Emit SOUL_FIRE_FLAME and periodic AoE damage + Weakness II to nearby enemies. - Scheduled rotation and cleanup server-side (batched). - Witch Flight alternative: - CD 2400 ticks, 15s creative-like flight ×2 speed with SLOW_FALLING on end. PUMPKIN SENTINELS / PUMPKIN SENTRY SYSTEM (v151/v152/v155 merged final) - v155 COMPLETE REWORK (final specifics): - 8 floating pumpkin sentries (invisible armor stands with JACK_O_LANTERN head). - ArmorStand properties: setInvisible(true); setMarker(true); setInvulnerable(true). Only pumpkin head visible; projectiles pass through armor stands. - Positioning: circle radius 3.5 around player; heights alternate y+1.0,y+1.5,y+2.0 repeating. - Orbit: increment orbitRotation by 1.5° per tick (full rotation 240 ticks = 12s); bobOffset = 0.15 * sin(time * 0.1 + i * 0.5). - Ground circle indicator: SOUL particles under each pumpkin circle every 2 ticks. - Independent target detection: scan within 15 blocks per pumpkin; ignore owner & ArmorStandEntity. - Shooting: per-pumpkin fire every 20 ticks (1s) after target acquired. Projectile = small JACK_O_LANTERN ItemEntity, no gravity, velocity 1.0 block/tick, tag ignore_armor_stands true. Damage on hit = 6.0. Hit effects: 15 ITEM_CRACK, 10 FLAME particles, sound BLOCK_WOOD_BREAK pitch 1.5. - Duration: active 30s (600 ticks). Cleanup: remove armor stands, stop particles/sounds. Cooldown: 45s before reactivation. - All actions server-side; remove existing sentinels before spawning new ones. HALLOWEEN ARENA (v36..v163 combined authoritative behavior) - Activation: - Hold Y for 100 ticks (5s). Client shows actionbar percent. - v163 ENTRY flow: server receives "reaper:arena_enter" after client holds Y uninterrupted for 100 ticks. Check arena_cd; if world.getTime() < arena_cd → send remaining time and abort. On success set arena_entry_time = world.getTime(), store origin_x,y,z, total_bosses = random(1..7), bosses_killed=0, add scoreboard tag "in_arena", teleport player to arena spawn, set time/night, schedule first boss spawn at +100 ticks. DO NOT set cooldown on entry. - Structure & protection (v36/v85 mandated): - Hollow BARRIER cube 53x53x32 (walls x/z = -26..26, interior x/z = -25..25, y=0..31 interior y=1..30 empty). - Prevent block place/break inside; prevent mob spawning inside except manual bosses; arena blocks indestructible to boss projectiles. - Store arena coordinates and owner UUID server-side (do NOT store full block lists in CUSTOM_DATA). - Interior terrain & build: - v86 randomized interior: base ground y=1→3 mix: 50% PODZOL, 20% SOUL_SAND, 15% COARSE_DIRT, 10% MOSS_BLOCK, 5% MYCELIUM; small hills/dips; thematic corner structures. - Build tick0–40 batched; teleport player to arena center at tick40. - Boss system & timing (v87/v93/v94/v146/v163): - First boss spawns 100 ticks after teleport; subsequent bosses spawn 60 ticks after previous death. - Multi-boss queue random 1–7 bosses per run (v163 sets total_bosses = random(1..7)). - Boss positions spawn near arena edge (18–25 blocks). - Jumpscares scheduled every 30–60s per boss (v146 adds super-attacks). - Loot & collection (v87/v146/v154/v158/v163): - On boss death collect ItemEntity drops within 10 blocks into temporary arenaLoot list and remove ItemEntities (prevent duplication). - At arena end transfer items to player inventory via insertStack(); if inventory full drop remaining near player. - v146: teleport player back to origin BEFORE delivering loot; after teleport wait 1 tick then insert loot; set arena cooldown accordingly. - v158 & v163: If insertStack fails, stash serialized ItemStack in CUSTOM_DATA.pending_loot per player UUID and retry on next login/respawn; fallback to drop at feet. Use DataComponentTypes-based ItemStack serialization and transactional delivered flag reward_delivered. - v163: Reward rules changed: award EXACT ONE reward on exit (if ≥1 boss killed) chosen by Tier computed from bosses_killed (0=no item; 1=Tier1; 2–3=Tier2; ≥4=Tier3). Build EXACT ONE ItemStack server-side and attempt insert; if fails add to pending_loot. Set arena_cd = world.getTime() + 4800 (4 minutes) ON EXIT only. Persist reward_delivered true and save pending_loot if any. - Cleanup (v88): - On exit/timer end: transfer loot to player, teleport player back to saved overworld pos, remove entities inside arena, batched set interior blocks to AIR, wait 5s then remove BARRIER blocks, clear session data, send “Halloween Arena has been cleared.” - Exit & cooldown rules (v149 + v163 fixes): - Exit ONLY when: - world.getTime() - arena_entry_time >= 6000 (5 min timeout) OR - player death at 0 HP via PlayerDeathEvent (if player has "in_arena" tag) OR - bosses_killed == total_bosses (victory) OR - Manual exit: "reaper:arena_exit" after 100-tick hold while "in_arena". - DO NOT exit on health < max or other tick-loop health checks. - Arena reward & distribution (v154/v158/v163): - On arena exit always grant ONE reward item if bosses_killed >=1. v163 Tier mapping: - Tier1 (bosses_killed == 1): choose ONE of: • 20x Diamond Block • 40x Emerald Block • 5x Netherite Ingot • Enchanted Book (Efficiency 15, Fortune 10, Unbreaking 10) - Tier2 (bosses_killed == 2–3): choose ONE of: • Hellforged Pickaxe (Netherite, Efficiency15, Fortune10, Unbreaking10, Mending, custom name/lore) • Reaper's Cleaver (Netherite Axe, Sharpness20, Looting10, Unbreaking10, Mending, +4 attack attribute) • Pumpkin Crown (Jack_O_Lantern helmet, Protection15, Unbreaking10, +10 max health attribute) - Tier3 (bosses_killed >=4): choose ONE of: • Soul Reaver (Netherite Sword, Sharpness30, Looting10, Unbreaking15, Mending, +6 attack, on-kill Strength II for 10s) • Reaper's Visage (Netherite Helmet, Protection25, Unbreaking15, Mending, Thorns5, +10 max health, grants Resistance I while worn) • Hammer of the Abyss (Netherite Pickaxe, Efficiency25, Fortune15, Unbreaking15, Mending, tag "mines_3x3"=true) • Totem of Tiny Terror (Totem, offhand-only, applies scale 0.25 while in offhand) — special Totem behavior, set custom tag "reaper_totem". - Implementation: Build ItemStack with DataComponentTypes.ENCHANTMENTS, DataComponentTypes.CUSTOM_NAME, DataComponentTypes.LORE, DataComponentTypes.ATTRIBUTE_MODIFIERS. Teleport player to origin, server.execute(() -> try insertStack(); if false add to pending_loot list). Set arena_cd = world.getTime() + 4800 ON EXIT. Persist reward_delivered flag true. - Only ONE reward per arena run. - v158/v163 persistence: pending_loot must be serialized list in CUSTOM_DATA per owner; retry deliver on respawn/login; drop at feet if still fails. BOSSES & SEQUENCING - 7 modular bosses: Pumpkin King (~400HP), Headless Horseman (~450), Witch Queen (~350), Spectral Reaper (~500), Candy Golem (~600), Soul Warden (~700), Corrupted Mage (~400) — HP configurable. - Store active boss UUID in reaper:active_boss_uuid and spawned entity UUIDs in reaper:spawned_entities (UUIDs only). Tag bosses "arena_boss". Use reaper:drops_handled to prevent duplicate loot handling. - Jumpscare super-attacks (v146): per-boss, cooldown 20s, must exist 10+s before first use; track last_jumpscare_time in boss entity NBT; unique behaviors defined. Implement safe scheduling & capability checks. - v160 Headless Horseman fix: implement HeadlessHorsemanEntity as single HostileEntity (no mount), ChargeAttackGoal, MeleeAttackGoal, ActiveTargetGoal, tick() fire trail every 5 ticks, ensure movement non-stuck, isInvulnerableTo returns false, larger hitbox (horse-sized), movement speed 1.5x, equip NETHERITE_SWORD with FIRE_ASPECT 3 and SHARPNESS 5, set GENERIC_ATTACK_DAMAGE base to 12.0 for dome zombies and specifics for horseman. - v163: Boss soul credit mapping on boss death by player using Reaper's weapon — add souls to weapon CUSTOM_DATA soul_count persistently: - PumpkinKing +50 - WitchQueen +60 - HeadlessHorseman +70 - SpectralReaper +80 - CorruptedMage +90 - SoulWarden +100 - CandyGolem +150 SOUL PROGRESSION & DAMAGE SCALING (v89) - v89: soul_count +1 per mob kill with this weapon; persistent on item. - Damage Bonus: Every 50 souls = +1 Attack Damage (max +50). Store "damage_tier" in CUSTOM_DATA; apply via AttributeModifiersComponent or server-side pattern. - Tier-up notifications: ENTITY_PLAYER_LEVELUP sound (pitch 1.5 vol 1.0), 50x SOUL_FIRE_FLAME particles, Title 5s. - Kill detection: server-side entity death event; if player killed with ReapersHarvestItem call incrementSouls(heldItem), checkTierUp, displaySoulProgress. - v163: boss-specific soul credits added as above. SOUL HARVEST ORB EFFECTS - Marked kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count. - Orb pickup handled server-side and updates lore/actionbar. LOOT & RARITY (v91/v154/v158/v163) - Loot Tier = BossesKilled + TimeBonus historically; v163 overrides to ONE reward based on bosses_killed tiers (Tier1/2/3). - Tier definitions Tier1→Tier3 exact choices per v163. Use DataComponentTypes for item construction. Guarantee at least one reward if bosses_killed >=1. - v158: persistent pending_loot fallback via CUSTOM_DATA.pending_loot per player UUID and transactional delivered flag. DATA SIZE MANDATES (v54 CRITICAL) - MUST NOT store huge block-pos lists in CUSTOM_DATA (>50k or >100 items). For cleanup store centers/radii only; recompute blocks or keep server-side lists. - Small structure position lists (4–7) allowed for dome cleanup (v161). CRASH & NPE / SAFE PATTERNS (v42/v48/v53/v58) - ServerWorld validation for particle spawning; defensive null-checks; try/catch around particle/sound spawns; replace Thread.sleep with scheduled server tasks; implement spawnParticlesSafe; batch arena build into 60 batches; teleport only after build completes. IMPLEMENTER CHECKLIST (actionable) 1) Client keybinds & client packet sending only when main-hand holds item; server GlobalReceiver validate ownership. 2) ReapersHarvestItem extends SwordItem; stats: Attack 35, AttackSpeed -2.4f; hasGlint=false; Netherite ToolMaterial. 3) use(): server-only branch to call activateHauntedDome when sneaking else activateSoulHarvest; return TypedActionResult.success(stack). 4) All dynamic state & cooldowns in DataComponentTypes.CUSTOM_DATA; lore updated server-side every 20 ticks using Text.literal().styled(.withItalic(false)). 5) Cooldowns read/written with world.getTime(); keys: harvest_cd, dome_cd, reaper_cd, arena_cd, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities, reaper:drops_handled, soul_count, damage_tier. 6) Haunted Dome: follow v60 behavior (radius 25 shell, decoration algorithm, spawn 10 zombies, team, 40-tick destruction, minimal metadata stored). Apply v147 equipDomeServant() for all zombies immediately after spawn. Apply v160 construction-speed and zombie spawn timing, extended target range. Apply v161 random structures (4–7 unique per dome), timings tick0–20 glass+floor, tick21–35 structures, tick36–40 spawn zombies. Store small structure positions in CUSTOM_DATA for cleanup if needed. 7) Soul Harvest: server-side forward area, glowing 100 ticks, orb grants +2 Absorption (cap +10), increments soul_count. 8) Soul Reaper: 8 orbiting armor stands for ~8s (CD 900) with AoE damage + Weakness II, scheduled rotation/cleanup. 9) Halloween Arena: Hold Y 100 ticks; v85 BARRIER cube; v86 randomized interior (store arenaBlocks server-side); tick0–40 build; teleport tick40; first boss 100 ticks after teleport; 60 ticks between boss deaths; collect boss drops into arenaLoot; transfer to player via insertStack() at end; follow v94/v146 teleport-before-deliver and pending_arena_loot flow; v158 persistence fallback; v163 single-reward & pending_loot/reward_delivered flags and boss soul credits. 10) BossManager: implement 7 bosses with unique equipment/AI/jumpscares; store active boss UUIDs; handle drops via reaper:drops_handled. 11) Implement Pumpkin Sentinels per v155 (armor stand invis/marker/invulnerable, radius 3.5, varied heights pattern, orbit 1.5°/tick, bobbing, ground SOUL particle circles every 2 ticks, per-pumpkin target scans (15-block), JACK_O_LANTERN projectile every 20 ticks at 1.0 block/tick, damage 6.0, 30s duration, 45s cooldown). 12) Particle/sound budgets; spawnParticlesSafe wrapper; try/catch; batch heavy operations across ticks; defensive null checks. 13) Testing & polish: ensure no NPEs; safe registry lookups; no oversized CUSTOM_DATA; lore/actionbar correctness; particle & sound caps; boss AI & loot correctness. 14) Haunted Dome uniqueness (v161): implement structure pool shuffle, pick 4–7, find safe positions with spacing >=8, build variants, store small positions string "x,y,z;x,y,z" in CUSTOM_DATA for cleanup, ensure zombies avoid structures. ARENA (v163) DETAILED SERVER FLOW & REQUIRED CUSTOM_DATA KEYS - KEY DATA (store in weapon CUSTOM_DATA per owner): - arena_entry_time (long) - origin_x,y,z (double) - total_bosses (int) - bosses_killed (int) - soul_count (int) - pending_loot (serialized list) - arena_cd (long) - reward_delivered (boolean) - arena_death_pending (boolean) — used on death flow - ENTRY (Hold Y 5s): - Server receives "reaper:arena_enter". - If world.getTime() < arena_cd → send remaining time and abort. - On success: arena_entry_time = world.getTime(); store origin coords; total_bosses = random(1..7); bosses_killed=0; add scoreboard tag "in_arena"; teleport player to arena spawn; set night; schedule first boss spawn at +100 ticks. DO NOT set cooldown here. - MANUAL EXIT (Hold Y 5s inside): - Server receives "reaper:arena_exit" after uninterrupted 100-tick hold while player has "in_arena". Call exitArena(player,"MANUAL"). - TIMER (Auto timeout): - Server tick loop: if player has "in_arena" ONLY check timePassed = world.getTime() - arena_entry_time; if timePassed >= 6000 → exitArena(player,"TIMEOUT"). Do NOT check health or other conditions here. - DEATH: - PlayerDeathEvent: if player had "in_arena": mark pending reduced rewards into pending_loot, set arena_death_pending flag in CUSTOM_DATA, remove "in_arena", schedule cleanup. On PlayerRespawnEvent, teleport to origin then server.execute after 1 tick to attempt deliver pending_loot to inventory (insertStack), drop at feet if still full. - exitArena(player, reason): - Remove "in_arena". - Compute reward tier from bosses_killed: • 0 = none (no item) • 1 = Tier1 • 2–3 = Tier2 • ≥4 = Tier3 - Build EXACT ONE ItemStack server-side from specified tier list (use DataComponentTypes.ENCHANTMENTS, DataComponentTypes.CUSTOM_NAME, DataComponentTypes.LORE, DataComponentTypes.ATTRIBUTE_MODIFIERS). For Totem special behavior set custom tag "reaper_totem". - Teleport player to origin (overworld). After teleport server.execute(() -> try player.getInventory().insertStack(item); if false add to pending_loot list). - Set arena_cd = world.getTime() + 4800 (4 minutes) — ONLY on exit. - Persist reward_delivered as true and save pending_loot if any. - Clean arena entities/blocks. - Reward delivery: teleport-before-deliver; 1-tick delay to insert; if insert fails add to CUSTOM_DATA.pending_loot for retry on respawn/login. DEVELOPER FINAL ENFORCEMENT - Fabric 1.21.5-compatible code. - All dynamic state uses DataComponentTypes.CUSTOM_DATA & DataComponentTypes.LORE (small primitives only). - Never store large block lists in CUSTOM_DATA. - spawnParticlesSafe wrapper & try/catch for particle/sound spawns. - All heavy tasks scheduled on server tick scheduler (server.execute) with batched edits. - Update lore exactly every 20 server ticks using Text.literal().styled(.withItalic(false)); global rebuild across all inventories. - Implement Haunted Dome per v60 and v147, including v160 construction-speed/zombie timing and extended hostiles pull behavior, and v161 random structures & dome_cd = +1200. - Implement HeadlessHorseman as single entity per v160 with bossbar fix. - Implement Soul Harvest, Soul Reaper/Witch Flight, Pumpkin Sentinels v155, Halloween Arena full lifecycle (v85..v163 rules), BossManager (7 bosses), Soul progression v89, Loot system per v158/v163. - Ensure cooldowns per v148 independent-key rules and initialization behavior except where later edits override (dome_cd = v161; arena_cd set only on exit per v163). - Ensure arena exit rules per v149 and reward delivery/order per v146/v158/v163 (teleport before deliver, 1 tick delay, pending_loot fallback). - Add robust fallbacks for reward delivery (pending_loot) and ensure idempotent delivered flag. - Implement logging and validation for chunk loads/teleports; avoid NPEs. VERSION HIGHLIGHTS & EVOLUTION (chronological; each line = important changes) - v1: Original features: Reaper’s Harvest, Haunted Dome, Soul Harvest, Witch Flight, Souls progression, boss ideas. - v2: Added Halloween Arena & boss system, save/restore player inventory via DataComponents. - v5: Fixes: hasGlint=false, extend SwordItem, Netherite ToolMaterial, keybind registration, use() override, store cooldowns in DataComponents. - v6: Combat & dome specifics set; arena_center y+80; store in DataComponents. - v8: Consolidation: controls, abilities, cooldowns, lore updates every 20 ticks, Soul Harvest refined. - v10–v13: Cooldown system concretized; Flight replaced by Soul Reaper option (v13); dome CD historically modified. - v28–v31: Stability & polish: DataComponents-only, dome crash checks, arena terrain & decoration, 7 bosses, particle/perf caps. - v35 (MANDATORY): Dome stabilization; spawn 10 zombies, transforms, batched build, active 20s, minimal storage. - v36 (MANDATORY): Arena 53x53x32 BARRIER cube; staged batching. - v37 (MANDATORY): Boss sequencing: 7 modular bosses, spawn logic, active boss UUID storage. - v42, v48, v53 (MANDATORY): NPE & particle crash fixes; spawnParticlesSafe. - v54 (CRITICAL): DATA SIZE LIMIT FIX — MUST NOT store block lists in CUSTOM_DATA. - v58 (CRITICAL): Arena build batching precompute & schedule; teleport only after build complete. - v59: Halloween sound mappings & cooldown examples. - v60 (MANDATORY): Haunted Dome COMPLETE REWORK: instant shell radius ≈25, decoration algorithms, team mechanics, destruction sequence, zombie gear/AI. - v72: Lore & cooldown UI finalization; atomic server-side lore update. - v82: Lore smoothing, Haunted Dome stabilization, registry safe lookups. - v85: HALLOWEEN ARENA - PART 1: STRUCTURE & PROTECTION. - v86: HALLOWEEN ARENA - PART 2: RANDOM TERRAIN — store arenaBlocks server-side. - v87: HALLOWEEN ARENA - PART 3: TELEPORT, BOSS SPAWN, LOOT. - v88: HALLOWEEN ARENA - PART 4: CLEANUP & RESET. - v89: REAPER'S HARVEST — Complete Lore & Soul Progression exact template. - v91: Arena Loot & Rarity System introduced. - v93: HALLOWEEN ARENA - COMPLETE BOSS SYSTEM (ONE-TRY). - v94: HALLOWEEN ARENA - FINAL FIXED ONE-TRY SYSTEM: global lore rebuild every 20 ticks; teleport/loot ordering. - v96: REAPER'S HARVEST - ULTIMATE COMPLETE FIX — Dynamic Lore System & Boss Equipment details. - v146: CRITICAL FIXES — Boss jumpscare super attacks + Loot Distribution fix (pending_arena_loot, teleport-before-deliver). - v147: CRITICAL Fix 5 — Dome Servant Equipment exact specs; mandatory equipDomeServant() immediately after spawn. - v148: LORE & COOLDOWN SYSTEM - COMPLETE FIX — server 20-tick global lore rebuild; independent cooldown keys; initialize cooldowns to 0. - v149: ARENA INSTANT DEFEAT - EMERGENCY FIX — exit only on timeout, death, or victory. - v151: PUMPKIN SENTINELS — initial sentinels ability. - v152: PUMPKIN SENTINEL REWORK — optimize schedules. - v154: ARENA REWARD & BOSS EQUIPMENT REWORK — adaptive loot guarantee. - v155: PUMPKIN SENTRIES - FINAL REWORK. - v158: Rebuild Arena Loot System for Fabric 1.21.5 — DataComponentTypes-based persistent pending_loot fallback. - v160: Dome and Horseman Fixes (final edit): dome build speed, zombie spawn timing, extended target range, HeadlessHorseman entity fixes. - v161 (LATEST EDIT before v163): HAUNTED DOME - RANDOM STRUCTURES: dome_cd set to +1200 (60s) after cleanup; Tick0–20 build glass+floor; Tick21–35 spawn 4–7 unique structures; Tick36–40 spawn zombies; store small structure pos list for cleanup. - v163 (LATEST EDIT): REAPER'S HARVEST — Part 1: Arena & Loot (Fabric 1.21.5): - Target: server-side Fabric 1.21.5 code; Use DataComponentTypes.CUSTOM_DATA only. - Fix hold-Y entry/exit; award EXACT ONE reward on exit (if ≥1 boss killed); persist pending_loot; credit souls on boss death. - New CUSTOM_DATA keys: arena_entry_time, origin_x,y,z, total_bosses, bosses_killed, soul_count, pending_loot (serialized list), arena_cd, reward_delivered, arena_death_pending. - ENTRY: "reaper:arena_enter" checks arena_cd, sets arena session data, random total_bosses 1..7, schedules boss spawn at +100 ticks, DO NOT set cooldown. - MANUAL EXIT: "reaper:arena_exit" after 100-tick hold -> exitArena(player,"MANUAL"). - TIMER: auto-exit at 6000 ticks since entry only. - DEATH: on PlayerDeathEvent handle pending_loot & respawn delivery. - exitArena: teleport-back THEN try insertStack OR add to pending_loot; set arena_cd = world.getTime() + 4800 ON EXIT; persist reward_delivered. - Reward table EXACT Tier1/2/3 choices listed; Totem has special offhand scaling behavior; build items via DataComponentTypes. - Boss soul credits mapping provided (PumpkinKing +50, WitchQueen +60, HeadlessHorseman +70, SpectralReaper +80, CorruptedMage +90, SoulWarden +100, CandyGolem +150). - Safety: validate chunks loaded, schedule heavy tasks, serialize pending_loot via DataComponents, only one reward per run. v171 EDIT (TARGET & NEW REQUIREMENTS) - TARGET: Fabric 1.21.5 mod generator. Produce compact, safe server-side code to implement changes below. Use DataComponents for persistent item data. Avoid huge particle bursts, validate chunks, and schedule repeating tasks rather than blocking the server thread. - GOAL: Replace sentinel projectiles with ArmorStand projectiles; polish boss visuals; rewrite Horseman mount; keep everything performant and robust. 1) SENTINELS → ArmorStand projectiles (replacement + behavior) - Sentinels: spawn 8 sentinels orbiting player radius 3.5, heights alternate 1.0/1.5/2.0...; angular speed ≈ 1.5°/tick; bob formula y += sin(worldTime*0.1 + i*0.5)*0.15. - Targeting scan: every 10 ticks each sentinel scans within 15 blocks for nearest hostile or non-owner player; store target UUID on sentinel persistent data (DataComponents). - Charge sequence: when target acquired, play 15-tick charge (small spiral of 15 FLAMEs), play BLOCK_FIRE_AMBIENT. - Fire cadence: each sentinel fires every 25 ticks. Fire spawns an ArmorStand projectile with: - properties: invisible, marker, noGravity, small, tag "pumpkin_projectile". - store velocity vx,vy,vz and lifetime in its persistent data (DataComponents). - velocity = normalize(targetPos - headPos) * 1.2 (blocks/tick). - Projectile tick (server tick scheduler): - move projectile by velocity; increment lifetime. - trail: low-rate particles (cap: e.g. 5 FLAME, 3 SMOKE, 2 SOUL_FIRE per tick across all projectiles). - collision: check entities within 0.5 block (exclude owner & sentinels). On hit: entity.damage(DamageSource.magic(), 6.0f) → spawn burst (moderate particles), play ENTITY_GENERIC_EXPLODE and BLOCK_FIRE_EXTINGUISH, small knockback, remove projectile. - timeout: if lifetime > 60 ticks, spawn 10 SMOKE, play extinguish, remove projectile. - Animations: tile sentinel tilting when firing (tilt 15° for 5 ticks). - Cap particle counts and spread them across ticks. Use spawnParticlesSafe and try/catch. Store per-projectile state in DataComponents. 2) CORRUPTED MAGE boss polish - Equip helmet = PURPLE_WOOL block ItemStack; setEquipmentDropChance HEAD = 0; entity.setGlowing(true). 3) SOUL WARDEN boss polish - Helmet = LAPIS_BLOCK. Chest/legs/boots = LEATHER dyed navy (0x191970). Equip and set drop chances 0.0. entity.setGlowing(true). 4) CANDY GOLEM boss polish & death effect - Helmet = IRON_BLOCK. Leather armor dyed pink (0xFFC0CB). Equip, drop_chances 0.0, glowing true. - On Candy Golem death: add +5 to bosses_killed in weapon DataComponents (counts as 5). 5) HORSEMAN (robust mount rewrite) - Spawn SkeletonHorseEntity first; setTamed(true), setAiDisabled(true), setInvulnerable(true), silent, tag "arena_horseman_mount" and "no_block_break". - Spawn WitherSkeleton rider; equip WITHER_SKELETON_SKULL; set drop chance 0; tag "arena_horseman_rider". - world.spawnEntity(horse), world.spawnEntity(rider); rider.startRiding(horse,true). - Schedule repeating controller task: - if both alive ensure rider mounted; find nearest target ≤25 blocks; compute direction; movement = direction * 0.12; check ground under newPos to avoid falls; setPosition(newPos) and yaw; if dead discard both. - Prevent block break by canceling BlockBreak events for entities with tags above. 6) SAFETY & PERFORMANCE (enforced) - Always check chunk loaded before setBlock/setEntity or schedule operation. - Use scheduler for repeating tasks (2-tick sentinel motion, per-tick projectile updates, 10-tick targeting). - Cap per-tick particles (small repeated bursts) and spread across ticks. - Use DataComponents for storing per-entity/projectile persistent values. 7) VALIDATION CHECKLIST (generator must implement) - Sentinels spawn, orbit, detect targets, play charge, fire ArmorStand projectiles that deal 6 damage, produce moderate explosion visuals, timeout and removed. - Corrupted Mage wears purple wool helmet and glows. - Soul Warden has lapis helmet + navy leather tunic and glows. - Candy Golem has iron-block head + pink leather armor; death increments bosses_killed by 5. - Horseman spawns mounted on skeleton horse, horse cannot break blocks and moves with controlled slow movement. - No huge single-tick particle bursts; chunks validated; tasks scheduled safely. 8) DELIVERABLE (requested by edit v171) - Server-side Java code snippets for: - spawn handlers (sentinels and boss equipment) - sentinel scheduler (orbit motion, targeting every 10 ticks, charge effect) - ArmorStand projectile lifecycle (spawn, tick movement, collision, timeout, DataComponents usage) - boss spawn adjustments (Corrupted Mage, Soul Warden, Candy Golem equip + death special) - horseman controller (mount spawn, rider spawn, repeating movement task, block-break prevention tag checks) - event listeners to cancel block breaking for tagged entities/ mounts - brief note on required hooks: server tick scheduler registration, entity spawn hooks, block/chunk checks, event cancellations - All code must: - be compact, safe, server-side, Fabric 1.21.5-compatible - use DataComponents for persistent per-entity/projectile/sentinel values - validate chunks & schedule tasks (no blocking) - use spawnParticlesSafe and caps for particle volumes - include comments indicating where to wire into existing managers (ArenaManager, BossManager, ReapersHarvestItem flows) END — authoritative summary combining original request + all edits through v171. Edit v172: TARGET: Fabric 1.21.5 server-side generator. Rework boss damage scaling & loot-safety system. MUST use DataComponentTypes (NO raw NBT). Return compact Java-ready pseudocode + DataComponent calls. Keep server-side scheduled tasks, non-blocking, chunk-checked, particle-budgeted. GOALS (brief) 1. Reliable getPlayerProtectionLevel(player) that sums Protection enchant levels on HEAD/CHEST/LEGS/FEET using DataComponentTypes.ENCHANTMENTS. 2. Per-boss damage formulas: safe base, multiplier, minimum. Apply via entity.damage(DamageSource.mob(boss), damage). 3. Clamp Resistance from loot to <= III; replace excessive Resistance with Regeneration/Absorption/+maxHealth. 4. Soul Reaver on-kill Strength buff: 5s duration, 30s cooldown tracked on item via DataComponentTypes.CUSTOM_DATA key "soul_reaver_last_strength". 5. All enchantments, names, lore and attributes set through DataComponentTypes APIs. CORE FUNCTIONS (pseudocode style) int getPlayerProtectionLevel(ServerPlayerEntity p) { int prot = 0; for (EquipmentSlot s : new EquipmentSlot[]{HEAD, CHEST, LEGS, FEET}) { ItemStack st = p.getEquippedStack(s); var enchMap = st.get(DataComponentTypes.ENCHANTMENTS); if (enchMap != null) prot += safeGetEnchantmentLevel(enchMap, Enchantments.PROTECTION); } return prot; } float calcDamage(float BASE, float MULT, float MIN, int prot) { float damage = BASE - (prot * MULT); return Math.max(damage, MIN); } BOSS SCHEDULE PATTERN (safe scheduler) scheduleRepeating(intervalTicks, () -> { if (!boss.isAlive()) cancel(); LivingEntity t = findNearestValidTarget(boss, range); if (t==null) return; int prot = getPlayerProtectionLevel((ServerPlayerEntity) t); float dmg = calcDamage(BASE, MULT, MIN, prot); t.damage(DamageSource.mob(boss), dmg); spawnLimitedParticles(boss.getPos(), maxParticles=50); }); BOSS FORMULAS (use constants) PumpkinKing: BASE=8f, MULT=0.15f, MIN=1f, INTERVAL=30 WitchQueen: BASE=6f total poison, MULT=0.12f, MIN=0.5f, apply poison over 5s HeadlessHorseman: BASE=10f, MULT=0.18f, MIN=1.5f, INTERVAL=40 SpectralReaper: BASE=12f, MULT=0.22f, MIN=2f, AOE radius=4, INTERVAL=50 CorruptedMage: BASE=9f, effectiveProt=prot*0.7, dmg=max(BASE - effectiveProt*0.15f,1.5f), INTERVAL=25 SoulWarden: BASE=11f, MULT=0.20f, MIN=2f, INTERVAL=35, boss.heal(2.0f) on hit CandyGolem: BASE=14f, MULT=0.25f, MIN=1f, melee; apply Slowness II for 60 ticks SOUL REAVER KILL BUFF onEntityDeath(event) { if (killer.holds("Soul Reaver")) { ItemStack s = killer.getMainHandStack(); long last = s.get(DataComponentTypes.CUSTOM_DATA).getLong("soul_reaver_last_strength",0L); if (world.getTime() - last >= 600) { // 30s killer.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH,100,1)); s.get(DataComponentTypes.CUSTOM_DATA).putLong("soul_reaver_last_strength", world.getTime()); spawnLimitedParticles(killer.getPos(),30); } } } LOOT & RESISTANCE GUARD ItemStack applyLootSafety(ItemStack item) { if (item.grantsResistanceLevel() > 3) { clampResistance(item, 3, duration=600); // if originally permanent: replace with Regeneration I or +maxHealth } clampEnchantLevels(item, maxByEnchantmentMap); // helper setLoreAndNameViaDataComponents(item); return item; } HELPERS - safeGetEnchantmentLevel(enchMap, ench): returns level or 0 - clampEnchantLevels(item, map): enforce server caps (e.g. Protection<=30 unless configured) - spawnLimitedParticles(pos, maxParticles): batch and throttle; reduce if players>12 in 40-block radius - chunkLoadedCheck(pos) before teleport/block operations PERFORMANCE & SAFETY - All repeating tasks via server scheduler; cancel when entity dead or chunk unloaded. - Particle budget: per-event <= 200; ambient <= 50. - Validate chunk loaded and permissions before block edits. - Do NOT use raw NBT; store persistent cooldowns/flags/uuids in DataComponentTypes.CUSTOM_DATA. VALIDATION CHECKLIST - [ ] getPlayerProtectionLevel works with DataComponent ENCHANTMENTS - [ ] Each boss damage formula applied at right cadence - [ ] Candy Golem applies Slowness and adjusted damage - [ ] Soul Reaver cooldown stored and checked in DataComponent - [ ] Loot items never give Resistance > III; excessive effects clamped/replaced - [ ] All data writes use DataComponentTypes Return Java-like code snippets implementing above helpers and constants. Keep logic concise, testable, and safe for multi-player servers.
1
Nov 1, 2025, 05:08 PM
User request: Mod: Reaper’s Harvest (Fabric 1.21.5) — legendary Halloween scythe/sword SUMMARY (developer-ready, machine-actionable). Contains original request + ALL edits through v163. Implement exactly. CORE ITEM - Class: ReapersHarvestItem extends SwordItem. - Stats: Attack = 35; AttackSpeed = -2.4f; hasGlint() -> false. - Use Netherite ToolMaterial. - All abilities server-authoritative. DATA STORAGE RULES (MANDATORY) - All dynamic/item state MUST use DataComponentTypes.CUSTOM_DATA (ONLY small primitives) & DataComponentTypes.LORE. - NEVER store large collections (>100 items) or block-position arrays in CUSTOM_DATA (v54 CRITICAL). - Allowed CUSTOM_DATA primitives (ONLY): small ints/longs/bools and minimal coords/UUIDs: arena_center coords, dome_center coords, radii, cooldown_end timestamps (world.getTime()), soul_count, damage_tier, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities (UUIDs only), reaper:drops_handled. Treat missing keys as defaults (0). - Small lists of structure positions for a single dome (4–7) permitted (v161) — still respect v54 limits. - Use DataComponentTypes for enchantments, custom name, lore, attribute modifiers; do NOT write raw NBT. THREADING, SCHEDULING & SAFETY - Server-authoritative: schedule heavy ops via server.execute or server tick scheduler. NEVER Thread.sleep. - Spread heavy ops across ticks; validate ServerWorld & chunk loading. - Defensive null checks; try/catch around particle/sound spawns. - Batch edits and particle bursts. - Implement spawnParticlesSafe(World, ParticleEffect, ...) wrapper: validate ServerWorld & !world.isClient, try/catch, cap and batch particles. Throttle loud sounds. - Log failures, validate chunks loaded before teleport/build. PARTICLE BUDGETS & THEME - Theme: jack-o’-lantern blade, purple ethereal mist, orange/black palette, constant purple particles/whispers. - Use vanilla sounds only (pitch/volume tweaks allowed). Dramatic particles and bossbars. - Particle budgets & recommended batching: - Haunted Dome ~15,000 SOUL_FIRE_FLAME over ~5s batched (v58 may cap ~3000 per event). - Soul Harvest 500 batched. - Soul Reaper pumpkins 40/tick. - Boss spawn 5,000 split across ticks. - Arena ambient 50 SOUL + 20 ASH per second. CONTROLS, UX & NETWORKING - Inputs: - Left Click = normal attack. - Right Click = Soul Harvest (use() override). - Shift + Right Click = Haunted Dome (use() override). - F Key = Soul Reaper (client KeyBinding mapped to FLIGHT_KEY). - Witch Flight = optional alternative to Soul Reaper. - Hold Y for 5s (100 ticks) = Halloween Arena mapped to ARENA_KEY. - Client: register Flight (F) & Arena (Y) KeyBindings in ClientModInitializer via KeyBindingHelper. ClientTickEvents.END_CLIENT_TICK handle keypress/hold and send packets only when main hand holds Reaper’s Harvest. - Networking Packet IDs: - "reaper:flight" - "reaper:arena" (legacy) - v163 explicit: "reaper:arena_enter" and "reaper:arena_exit" - Client sends FlightPayload/ArenaPayload only when main-hand holds item. Server registers GlobalReceiver; on receive validate player/world/item ownership; server.execute schedule work. Packet handlers validate ownership and schedule rather than run heavy inline work. STANDARDIZED KEYS & COOLDOWN RULES (latest authoritative set) - Standard keys: harvest_cd, dome_cd, reaper_cd (aka flight_cd), arena_cd; arena/session & boss keys: reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities, reaper:drops_handled; arena origin/center coords, session owner UUID, soul_count, damage_tier. - Use world.getTime() for timestamps; display READY/COOLDOWN/ACTIVE in lore/actionbar. - Independent cooldown rules (v148 finalizing, overridden where specified): - Each ability reads/writes ONLY its own cooldown key. - Harvest: set harvest_cd = world.getTime() + 10 (0.5s) AFTER use. - Haunted Dome: authoritative v161: set dome_cd = world.getTime() + 1200 (60s) AFTER cleanup (v148 previously set 600 — overridden). - Soul Reaper: set reaper_cd = world.getTime() + 900 AFTER use. - Arena: DO NOT set cooldown on entry; set arena_cd = world.getTime() + 4800 (4min) ON EXIT only. - Initialize cooldowns to 0 on item creation (v148 FIX 4). - Cooldown check pattern: compare world.getTime() vs cooldownEnd; if active show cooldown message; only write the relevant key when activating. LORE & UI (server authoritative; exact template) - DataComponentTypes.LORE updated every 20 server ticks server-side using Text.literal().styled(s->s.withItalic(false)). v72/v82 atomic lore update; v94/v148 global refresh. - EVERY 20 TICKS scan all online players' inventories and rebuild lore from zero for every Reaper’s Harvest instance (v148/v154/v155 enforcement). - Status icons (formatting exactness required): - READY: " §a§l✔ READY" - COOLDOWN: " §c§l⏳ M:SS" (v96: " §c§l⏳ {m}m {s}s") - ACTIVE: " §e§l⚡ ACTIVE" - Actionbar: hold‑Y progress percent, cooldowns and messages. Soul progress actionbar when collecting souls (v89). - EXACT LORE TEMPLATE (v89/v96 literal — MUST BE APPLIED VERBATIM server-side every 20 ticks using Text.literal().styled(.withItalic(false))): §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ REAPER'S HARVEST ⚔ §6§l ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §c§l⚔ §7Damage: §f§l35 §8┃ §d§l✦ §7Souls: §5§l{soul_count} §6§l▬▬▬▬ §5§lCURSED POWERS §6§l▬▬▬▬ §6§l◈ Soul Harvest §8§o(Right Click) §7Reap the souls of your enemies §7in a deadly sweeping arc {cooldown_status} §d§l◆ Haunted Dome §8§o(Shift + Right Click) §7Summon a cursed glass prison §7with 10 pumpkin servants {cooldown_status} §5§l✦ Soul Reaper §8§o(Press F) §7Unleash 8 orbiting spectral §7scythes of pure nightmare {cooldown_status} §c§l☠ Halloween Arena §8§o(Hold Y - 5 sec) §7Enter the eternal battleground §7and face the Seven Horrors {cooldown_status} §8§l▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ §6§o Halloween Edition By §f§lklow (Replace {cooldown_status} and {soul_count} dynamically; ready/cooldown/active strings must use specified formatting.) CORE CLASSES & METHODS (required) - ReapersHarvestItem extends SwordItem: implement use(); activateHauntedDome(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulHarvest(ServerWorld, ServerPlayerEntity, ItemStack); activateSoulReaper(...) / activateWitchFlight(...); activateArena(ServerWorld, ServerPlayerEntity, ItemStack). - Managers: ArenaManager & BossManager — handle ticked scheduling, incremental build/cleanup, boss sequencing, bossbars, custom drops. - All dynamic state & cooldown timestamps stored in DataComponentTypes.CUSTOM_DATA on ItemStacks and/or server-side session/components. - Defensive reads: safe defaults when DataComponents missing. - use(): server-only behavior: if user.isSneaking() -> activateHauntedDome(...) else -> activateSoulHarvest(...); return TypedActionResult.success(stack). - Update DataComponentTypes.LORE every 20 server ticks server-side; v96/v148 must initialize on first hold and then global 20-tick rebuild across all inventories. SPAWN/PARTICLES/SOUNDS SAFETY - Particle & sound spawns wrapped in try/catch and spawnParticlesSafe. - Throttle loud sounds and cap particle counts per budget. - Replace Thread.sleep with scheduled server tasks; batch arena and dome build into ticked batches. HAUNTED DOME (CONSOLIDATED; AUTHORITATIVE BEHAVIOR) - Geometry & build (v60 + v160 + v147 + v161 combined authoritative): - Shell: instant shell build at tick 0: x/z range -25..25, y 0..25 (radius ≈25). Build orange/ORANGE_STAINED_GLASS shell INSTANTLY tick0–20 (loop x=-25..25, z=-25..25, y=0..25; place glass where dist between 24.5 and 25.5). - Floor: build floor during tick0–20 (podzol/soul_sand/coarse_dirt/jack_o_lantern distribution: PODZOL 40%, SOUL_SAND 30%, COARSE_DIRT 20%, JACK_O_LANTERN 10%). - Decorations & random structures: - Timing authoritative (v161): Tick0–20: glass + floor; Tick21–35: spawn 4–7 random structures (unique per-dome; shuffle pool and pick 4–7; place with spacing, avoid center ±6 blocks; 2–3 randomized variants per structure). Tick36–40: spawn zombies after structures placed. - Decorations overlay algorithm (when not using full structures): shuffle glassBlocks, pick 70% to cover; overlay probs: COBWEB 30%, JACK_O_LANTERN 25%, SKULL 15%, SOUL_LANTERN 15%, CHAIN 10%, ORANGE_WOOL 5%; 30% remain clear. - DO NOT gradually build glass shell beyond tick0–20; decorations tick20–40; zombies spawn tick36–40. - Transformations: JACK_O_LANTERN, COBWEB, SOUL_LANTERN, WITHER_SKELETON_SKULL; ground transforms: Grass→PODZOL, Dirt→SOUL_SOIL, Stone→BLACKSTONE. - Random structure pool (v161): shuffle with world.random, pick 4–7 unique structures from pool (Graves, Pumpkins, Spooky, Magic, Altars, Graveyard, Campsite, Tree Stump, Pumpkin Patch, Witch Corner, Cage, etc.). Find safe positions with spacing >=8, avoid center ±6, build variants. - Mobs & gear: - Spawn 10 zombies with CARVED_PUMPKIN helmets (Curse of Binding), Copper armor dyed orange, Iron Sword with Fire Aspect II (+ Sharpness III per v147 exact), Strength II & Speed II; equipment drop chance = 0.0f. - Orange flame foot particles on zombies; custom AI. - v160: zombies spawn ONLY after dome fully built; find solid ground inside dome for each spawn; teleport random hostiles into dome if needed (target range dome radius + 16 = 41). - Team & AI: - Create team "haunted_dome_{ownerUUID}" (color GOLD, friendly fire OFF); add owner + zombies. - Clear zombies' default goals; add custom NearestAttackableTargetGoal targeting HostileEntity not in team and PlayerEntity not owner. - Remove team at dome end. - Lifecycle & timings: - Build: tick0–20 glass+floor; tick21–35 structures; tick36–40 spawn zombies; active ~20s preferred (remove after ~20s). - Destruction sequence: tick0-20 remove decorations top-down spawn SMOKE; tick20-40 remove glass top-down spawn FLAME; tick40 despawn zombies with PORTAL particles and delete team. (v160 refined cleanup sequencing). - Storage & metadata: - Only store minimal metadata in CUSTOM_DATA: center coords, radius, spawned zombie UUIDs (avoid block lists >100). - v161: store structure positions for cleanup as small list "x,y,z;x,y,z" allowed in CUSTOM_DATA (4–7 entries). - Recompute deterministic cleanup; incremental batched edits. - Cooldown: - v161 authoritative: dome_cd = world.getTime() + 1200 (60s) AFTER cleanup. - v147 — CRITICAL Fix 5 (EXACT): Servants must be equipped immediately after spawn via equipDomeServant(zombie). Exact equipment per servant (apply to ALL 10 zombies immediately): - Head: CARVED_PUMPKIN - Chest/Legs/Boots: COPPER_CHESTPLATE / COPPER_LEGGINGS / COPPER_BOOTS dyed orange - Weapon: IRON_SWORD with Fire Aspect II + Sharpness III - Effects: Strength II (infinite), Speed II (infinite) - Particles: 2 FLAME particles at feet every tick - Glow: ORANGE team color (use Glowing effect + team) - Drop Chances: ALL 0.0f - Application Timing: build glass dome -> teleport entities inside -> spawn 10 zombies in circle (4 blocks from center) -> immediately after each zombie spawn call equipDomeServant(zombie) -> add decorations. SOUL HARVEST - Mechanics: - Server-side forward 10-block forward box/cone dealing 25 damage (preferred); apply GLOWING for 100 ticks; Soul Mark lasts 5s. - Marked-kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count in CUSTOM_DATA. - Cooldown: - harvest_cd = world.getTime() + 10 ticks (0.5s) after use (v148). - Visuals: batched particle arcs; lore updates on kills; orb pickup server-side handling. Integrates with v89 soul progression. SOUL REAPER / WITCH FLIGHT (ALTERNATE) - Soul Reaper: - CD: reaper_cd = 900 ticks (45s). Duration 8s. - Spawn 8 orbiting scythes implemented as invisible no-gravity ArmorStands + NETHERITE_HOE heads rotating at 3-block radius. - Emit SOUL_FIRE_FLAME and periodic AoE damage + Weakness II to nearby enemies. - Scheduled rotation and cleanup server-side (batched). - Witch Flight alternative: - CD 2400 ticks, 15s creative-like flight ×2 speed with SLOW_FALLING on end. PUMPKIN SENTINELS / PUMPKIN SENTRY SYSTEM (v151/v152/v155 merged final) - v155 COMPLETE REWORK (final specifics): - 8 floating pumpkin sentries (invisible armor stands with JACK_O_LANTERN head). - ArmorStand properties: setInvisible(true); setMarker(true); setInvulnerable(true). Only pumpkin head visible; projectiles pass through armor stands. - Positioning: circle radius 3.5 around player; heights alternate y+1.0,y+1.5,y+2.0 repeating. - Orbit: increment orbitRotation by 1.5° per tick (full rotation 240 ticks = 12s); bobOffset = 0.15 * sin(time * 0.1 + i * 0.5). - Ground circle indicator: SOUL particles under each pumpkin circle every 2 ticks. - Independent target detection: scan within 15 blocks per pumpkin; ignore owner & ArmorStandEntity. - Shooting: per-pumpkin fire every 20 ticks (1s) after target acquired. Projectile = small JACK_O_LANTERN ItemEntity, no gravity, velocity 1.0 block/tick, tag ignore_armor_stands true. Damage on hit = 6.0. Hit effects: 15 ITEM_CRACK, 10 FLAME particles, sound BLOCK_WOOD_BREAK pitch 1.5. - Duration: active 30s (600 ticks). Cleanup: remove armor stands, stop particles/sounds. Cooldown: 45s before reactivation. - All actions server-side; remove existing sentinels before spawning new ones. HALLOWEEN ARENA (v36..v163 combined authoritative behavior) - Activation: - Hold Y for 100 ticks (5s). Client shows actionbar percent. - v163 ENTRY flow: server receives "reaper:arena_enter" after client holds Y uninterrupted for 100 ticks. Check arena_cd; if world.getTime() < arena_cd → send remaining time and abort. On success set arena_entry_time = world.getTime(), store origin_x,y,z, total_bosses = random(1..7), bosses_killed=0, add scoreboard tag "in_arena", teleport player to arena spawn, set time/night, schedule first boss spawn at +100 ticks. DO NOT set cooldown on entry. - Structure & protection (v36/v85 mandated): - Hollow BARRIER cube 53x53x32 (walls x/z = -26..26, interior x/z = -25..25, y=0..31 interior y=1..30 empty). - Prevent block place/break inside; prevent mob spawning inside except manual bosses; arena blocks indestructible to boss projectiles. - Store arena coordinates and owner UUID server-side (do NOT store full block lists in CUSTOM_DATA). - Interior terrain & build: - v86 randomized interior: base ground y=1→3 mix: 50% PODZOL, 20% SOUL_SAND, 15% COARSE_DIRT, 10% MOSS_BLOCK, 5% MYCELIUM; small hills/dips; thematic corner structures. - Build tick0–40 batched; teleport player to arena center at tick40. - Boss system & timing (v87/v93/v94/v146/v163): - First boss spawns 100 ticks after teleport; subsequent bosses spawn 60 ticks after previous death. - Multi-boss queue random 1–7 bosses per run (v163 sets total_bosses = random(1..7)). - Boss positions spawn near arena edge (18–25 blocks). - Jumpscares scheduled every 30–60s per boss (v146 adds super-attacks). - Loot & collection (v87/v146/v154/v158/v163): - On boss death collect ItemEntity drops within 10 blocks into temporary arenaLoot list and remove ItemEntities (prevent duplication). - At arena end transfer items to player inventory via insertStack(); if inventory full drop remaining near player. - v146: teleport player back to origin BEFORE delivering loot; after teleport wait 1 tick then insert loot; set arena cooldown accordingly. - v158 & v163: If insertStack fails, stash serialized ItemStack in CUSTOM_DATA.pending_loot per player UUID and retry on next login/respawn; fallback to drop at feet. Use DataComponentTypes-based ItemStack serialization and transactional delivered flag reward_delivered. - v163: Reward rules changed: award EXACT ONE reward on exit (if ≥1 boss killed) chosen by Tier computed from bosses_killed (0=no item; 1=Tier1; 2–3=Tier2; ≥4=Tier3). Build EXACT ONE ItemStack server-side and attempt insert; if fails add to pending_loot. Set arena_cd = world.getTime() + 4800 (4 minutes) ON EXIT only. Persist reward_delivered true and save pending_loot if any. - Cleanup (v88): - On exit/timer end: transfer loot to player, teleport player back to saved overworld pos, remove entities inside arena, batched set interior blocks to AIR, wait 5s then remove BARRIER blocks, clear session data, send “Halloween Arena has been cleared.” - Exit & cooldown rules (v149 + v163 fixes): - Exit ONLY when: - world.getTime() - arena_entry_time >= 6000 (5 min timeout) OR - player death at 0 HP via PlayerDeathEvent (if player has "in_arena" tag) OR - bosses_killed == total_bosses (victory) OR - Manual exit: "reaper:arena_exit" after 100-tick hold while "in_arena". - DO NOT exit on health < max or other tick-loop health checks. - Arena reward & distribution (v154/v158/v163): - On arena exit always grant ONE reward item if bosses_killed >=1. v163 Tier mapping: - Tier1 (bosses_killed == 1): choose ONE of: • 20x Diamond Block • 40x Emerald Block • 5x Netherite Ingot • Enchanted Book (Efficiency 15, Fortune 10, Unbreaking 10) - Tier2 (bosses_killed == 2–3): choose ONE of: • Hellforged Pickaxe (Netherite, Efficiency15, Fortune10, Unbreaking10, Mending, custom name/lore) • Reaper's Cleaver (Netherite Axe, Sharpness20, Looting10, Unbreaking10, Mending, +4 attack attribute) • Pumpkin Crown (Jack_O_Lantern helmet, Protection15, Unbreaking10, +10 max health attribute) - Tier3 (bosses_killed >=4): choose ONE of: • Soul Reaver (Netherite Sword, Sharpness30, Looting10, Unbreaking15, Mending, +6 attack, on-kill Strength II for 10s) • Reaper's Visage (Netherite Helmet, Protection25, Unbreaking15, Mending, Thorns5, +10 max health, grants Resistance I while worn) • Hammer of the Abyss (Netherite Pickaxe, Efficiency25, Fortune15, Unbreaking15, Mending, tag "mines_3x3"=true) • Totem of Tiny Terror (Totem, offhand-only, applies scale 0.25 while in offhand) — special Totem behavior, set custom tag "reaper_totem". - Implementation: Build ItemStack with DataComponentTypes.ENCHANTMENTS, DataComponentTypes.CUSTOM_NAME, DataComponentTypes.LORE, DataComponentTypes.ATTRIBUTE_MODIFIERS. Teleport player to origin, server.execute(() -> try insertStack(); if false add to pending_loot list). Set arena_cd = world.getTime() + 4800 ON EXIT. Persist reward_delivered flag true. - Only ONE reward per arena run. - v158/v163 persistence: pending_loot must be serialized list in CUSTOM_DATA per owner; retry deliver on respawn/login; drop at feet if still fails. BOSSES & SEQUENCING - 7 modular bosses: Pumpkin King (~400HP), Headless Horseman (~450), Witch Queen (~350), Spectral Reaper (~500), Candy Golem (~600), Soul Warden (~700), Corrupted Mage (~400) — HP configurable. - Store active boss UUID in reaper:active_boss_uuid and spawned entity UUIDs in reaper:spawned_entities (UUIDs only). Tag bosses "arena_boss". Use reaper:drops_handled to prevent duplicate loot handling. - Jumpscare super-attacks (v146): per-boss, cooldown 20s, must exist 10+s before first use; track last_jumpscare_time in boss entity NBT; unique behaviors defined. Implement safe scheduling & capability checks. - v160 Headless Horseman fix: implement HeadlessHorsemanEntity as single HostileEntity (no mount), ChargeAttackGoal, MeleeAttackGoal, ActiveTargetGoal, tick() fire trail every 5 ticks, ensure movement non-stuck, isInvulnerableTo returns false, larger hitbox (horse-sized), movement speed 1.5x, equip NETHERITE_SWORD with FIRE_ASPECT 3 and SHARPNESS 5, set GENERIC_ATTACK_DAMAGE base to 12.0 for dome zombies and specifics for horseman. - v163: Boss soul credit mapping on boss death by player using Reaper's weapon — add souls to weapon CUSTOM_DATA soul_count persistently: - PumpkinKing +50 - WitchQueen +60 - HeadlessHorseman +70 - SpectralReaper +80 - CorruptedMage +90 - SoulWarden +100 - CandyGolem +150 SOUL PROGRESSION & DAMAGE SCALING (v89) - v89: soul_count +1 per mob kill with this weapon; persistent on item. - Damage Bonus: Every 50 souls = +1 Attack Damage (max +50). Store "damage_tier" in CUSTOM_DATA; apply via AttributeModifiersComponent or server-side pattern. - Tier-up notifications: ENTITY_PLAYER_LEVELUP sound (pitch 1.5 vol 1.0), 50x SOUL_FIRE_FLAME particles, Title 5s. - Kill detection: server-side entity death event; if player killed with ReapersHarvestItem call incrementSouls(heldItem), checkTierUp, displaySoulProgress. - v163: boss-specific soul credits added as above. SOUL HARVEST ORB EFFECTS - Marked kills spawn purple orb that grants +2 Absorption hearts on pickup (cap +10) and increments soul_count. - Orb pickup handled server-side and updates lore/actionbar. LOOT & RARITY (v91/v154/v158/v163) - Loot Tier = BossesKilled + TimeBonus historically; v163 overrides to ONE reward based on bosses_killed tiers (Tier1/2/3). - Tier definitions Tier1→Tier3 exact choices per v163. Use DataComponentTypes for item construction. Guarantee at least one reward if bosses_killed >=1. - v158: persistent pending_loot fallback via CUSTOM_DATA.pending_loot per player UUID and transactional delivered flag. DATA SIZE MANDATES (v54 CRITICAL) - MUST NOT store huge block-pos lists in CUSTOM_DATA (>50k or >100 items). For cleanup store centers/radii only; recompute blocks or keep server-side lists. - Small structure position lists (4–7) allowed for dome cleanup (v161). CRASH & NPE / SAFE PATTERNS (v42/v48/v53/v58) - ServerWorld validation for particle spawning; defensive null-checks; try/catch around particle/sound spawns; replace Thread.sleep with scheduled server tasks; implement spawnParticlesSafe; batch arena build into 60 batches; teleport only after build completes. IMPLEMENTER CHECKLIST (actionable) 1) Client keybinds & client packet sending only when main-hand holds item; server GlobalReceiver validate ownership. 2) ReapersHarvestItem extends SwordItem; stats: Attack 35, AttackSpeed -2.4f; hasGlint=false; Netherite ToolMaterial. 3) use(): server-only branch to call activateHauntedDome when sneaking else activateSoulHarvest; return TypedActionResult.success(stack). 4) All dynamic state & cooldowns in DataComponentTypes.CUSTOM_DATA; lore updated server-side every 20 ticks using Text.literal().styled(.withItalic(false)). 5) Cooldowns read/written with world.getTime(); keys: harvest_cd, dome_cd, reaper_cd, arena_cd, reaper:boss_index, reaper:active_boss_uuid, reaper:spawned_entities, reaper:drops_handled, soul_count, damage_tier. 6) Haunted Dome: follow v60 behavior (radius 25 shell, decoration algorithm, spawn 10 zombies, team, 40-tick destruction, minimal metadata stored). Apply v147 equipDomeServant() for all zombies immediately after spawn. Apply v160 construction-speed and zombie spawn timing, extended target range. Apply v161 random structures (4–7 unique per dome), timings tick0–20 glass+floor, tick21–35 structures, tick36–40 spawn zombies. Store small structure positions in CUSTOM_DATA for cleanup if needed. 7) Soul Harvest: server-side forward area, glowing 100 ticks, orb grants +2 Absorption (cap +10), increments soul_count. 8) Soul Reaper: 8 orbiting armor stands for ~8s (CD 900) with AoE damage + Weakness II, scheduled rotation/cleanup. 9) Halloween Arena: Hold Y 100 ticks; v85 BARRIER cube; v86 randomized interior (store arenaBlocks server-side); tick0–40 build; teleport tick40; first boss 100 ticks after teleport; 60 ticks between boss deaths; collect boss drops into arenaLoot; transfer to player via insertStack() at end; follow v94/v146 teleport-before-deliver and pending_arena_loot flow; v158 persistence fallback; v163 single-reward & pending_loot/reward_delivered flags and boss soul credits. 10) BossManager: implement 7 bosses with unique equipment/AI/jumpscares; store active boss UUIDs; handle drops via reaper:drops_handled. 11) Implement Pumpkin Sentinels per v155 (armor stand invis/marker/invulnerable, radius 3.5, varied heights pattern, orbit 1.5°/tick, bobbing, ground SOUL particle circles every 2 ticks, per-pumpkin target scans (15-block), JACK_O_LANTERN projectile every 20 ticks at 1.0 block/tick, damage 6.0, 30s duration, 45s cooldown). 12) Particle/sound budgets; spawnParticlesSafe wrapper; try/catch; batch heavy operations across ticks; defensive null checks. 13) Testing & polish: ensure no NPEs; safe registry lookups; no oversized CUSTOM_DATA; lore/actionbar correctness; particle & sound caps; boss AI & loot correctness. 14) Haunted Dome uniqueness (v161): implement structure pool shuffle, pick 4–7, find safe positions with spacing >=8, build variants, store small positions string "x,y,z;x,y,z" in CUSTOM_DATA for cleanup, ensure zombies avoid structures. ARENA (v163) DETAILED SERVER FLOW & REQUIRED CUSTOM_DATA KEYS - KEY DATA (store in weapon CUSTOM_DATA per owner): - arena_entry_time (long) - origin_x,y,z (double) - total_bosses (int) - bosses_killed (int) - soul_count (int) - pending_loot (serialized list) - arena_cd (long) - reward_delivered (boolean) - arena_death_pending (boolean) — used on death flow - ENTRY (Hold Y 5s): - Server receives "reaper:arena_enter". - If world.getTime() < arena_cd → send remaining time and abort. - On success: arena_entry_time = world.getTime(); store origin coords; total_bosses = random(1..7); bosses_killed=0; add scoreboard tag "in_arena"; teleport player to arena spawn; set night; schedule first boss spawn at +100 ticks. DO NOT set cooldown here. - MANUAL EXIT (Hold Y 5s inside): - Server receives "reaper:arena_exit" after uninterrupted 100-tick hold while player has "in_arena". Call exitArena(player,"MANUAL"). - TIMER (Auto timeout): - Server tick loop: if player has "in_arena" ONLY check timePassed = world.getTime() - arena_entry_time; if timePassed >= 6000 → exitArena(player,"TIMEOUT"). Do NOT check health or other conditions here. - DEATH: - PlayerDeathEvent: if player had "in_arena": mark pending reduced rewards into pending_loot, set arena_death_pending flag in CUSTOM_DATA, remove "in_arena", schedule cleanup. On PlayerRespawnEvent, teleport to origin then server.execute after 1 tick to attempt deliver pending_loot to inventory (insertStack), drop at feet if still full. - exitArena(player, reason): - Remove "in_arena". - Compute reward tier from bosses_killed: • 0 = none (no item) • 1 = Tier1 • 2–3 = Tier2 • ≥4 = Tier3 - Build EXACT ONE ItemStack server-side from specified tier list (use DataComponentTypes.ENCHANTMENTS, DataComponentTypes.CUSTOM_NAME, DataComponentTypes.LORE, DataComponentTypes.ATTRIBUTE_MODIFIERS). For Totem special behavior set custom tag "reaper_totem". - Teleport player to origin (overworld). After teleport server.execute(() -> try player.getInventory().insertStack(item); if false add to pending_loot list). - Set arena_cd = world.getTime() + 4800 (4 minutes) — ONLY on exit. - Persist reward_delivered as true and save pending_loot if any. - Clean arena entities/blocks. - Reward delivery: teleport-before-deliver; 1-tick delay to insert; if insert fails add to CUSTOM_DATA.pending_loot for retry on respawn/login. DEVELOPER FINAL ENFORCEMENT - Fabric 1.21.5-compatible code. - All dynamic state uses DataComponentTypes.CUSTOM_DATA & DataComponentTypes.LORE (small primitives only). - Never store large block lists in CUSTOM_DATA. - spawnParticlesSafe wrapper & try/catch for particle/sound spawns. - All heavy tasks scheduled on server tick scheduler (server.execute) with batched edits. - Update lore exactly every 20 server ticks using Text.literal().styled(.withItalic(false)); global rebuild across all inventories. - Implement Haunted Dome per v60 and v147, including v160 construction-speed/zombie timing and extended hostiles pull behavior, and v161 random structures & dome_cd = +1200. - Implement HeadlessHorseman as single entity per v160 with bossbar fix. - Implement Soul Harvest, Soul Reaper/Witch Flight, Pumpkin Sentinels v155, Halloween Arena full lifecycle (v85..v163 rules), BossManager (7 bosses), Soul progression v89, Loot system per v158/v163. - Ensure cooldowns per v148 independent-key rules and initialization behavior except where later edits override (dome_cd = v161; arena_cd set only on exit per v163). - Ensure arena exit rules per v149 and reward delivery/order per v146/v158/v163 (teleport before deliver, 1 tick delay, pending_loot fallback). - Add robust fallbacks for reward delivery (pending_loot) and ensure idempotent delivered flag. - Implement logging and validation for chunk loads/teleports; avoid NPEs. VERSION HIGHLIGHTS & EVOLUTION (chronological; each line = important changes) - v1: Original features: Reaper’s Harvest, Haunted Dome, Soul Harvest, Witch Flight, Souls progression, boss ideas. - v2: Added Halloween Arena & boss system, save/restore player inventory via DataComponents. - v5: Fixes: hasGlint=false, extend SwordItem, Netherite ToolMaterial, keybind registration, use() override, store cooldowns in DataComponents. - v6: Combat & dome specifics set; arena_center y+80; store in DataComponents. - v8: Consolidation: controls, abilities, cooldowns, lore updates every 20 ticks, Soul Harvest refined. - v10–v13: Cooldown system concretized; Flight replaced by Soul Reaper option (v13); dome CD historically modified. - v28–v31: Stability & polish: DataComponents-only, dome crash checks, arena terrain & decoration, 7 bosses, particle/perf caps. - v35 (MANDATORY): Dome stabilization; spawn 10 zombies, transforms, batched build, active 20s, minimal storage. - v36 (MANDATORY): Arena 53x53x32 BARRIER cube; staged batching. - v37 (MANDATORY): Boss sequencing: 7 modular bosses, spawn logic, active boss UUID storage. - v42, v48, v53 (MANDATORY): NPE & particle crash fixes; spawnParticlesSafe. - v54 (CRITICAL): DATA SIZE LIMIT FIX — MUST NOT store block lists in CUSTOM_DATA. - v58 (CRITICAL): Arena build batching precompute & schedule; teleport only after build complete. - v59: Halloween sound mappings & cooldown examples. - v60 (MANDATORY): Haunted Dome COMPLETE REWORK: instant shell radius ≈25, decoration algorithms, team mechanics, destruction sequence, zombie gear/AI. - v72: Lore & cooldown UI finalization; atomic server-side lore update. - v82: Lore smoothing, Haunted Dome stabilization, registry safe lookups. - v85: HALLOWEEN ARENA - PART 1: STRUCTURE & PROTECTION. - v86: HALLOWEEN ARENA - PART 2: RANDOM TERRAIN — store arenaBlocks server-side. - v87: HALLOWEEN ARENA - PART 3: TELEPORT, BOSS SPAWN, LOOT. - v88: HALLOWEEN ARENA - PART 4: CLEANUP & RESET. - v89: REAPER'S HARVEST — Complete Lore & Soul Progression exact template. - v91: Arena Loot & Rarity System introduced. - v93: HALLOWEEN ARENA - COMPLETE BOSS SYSTEM (ONE-TRY). - v94: HALLOWEEN ARENA - FINAL FIXED ONE-TRY SYSTEM: global lore rebuild every 20 ticks; teleport/loot ordering. - v96: REAPER'S HARVEST - ULTIMATE COMPLETE FIX — Dynamic Lore System & Boss Equipment details. - v146: CRITICAL FIXES — Boss jumpscare super attacks + Loot Distribution fix (pending_arena_loot, teleport-before-deliver). - v147: CRITICAL Fix 5 — Dome Servant Equipment exact specs; mandatory equipDomeServant() immediately after spawn. - v148: LORE & COOLDOWN SYSTEM - COMPLETE FIX — server 20-tick global lore rebuild; independent cooldown keys; initialize cooldowns to 0. - v149: ARENA INSTANT DEFEAT - EMERGENCY FIX — exit only on timeout, death, or victory. - v151: PUMPKIN SENTINELS — initial sentinels ability. - v152: PUMPKIN SENTINEL REWORK — optimize schedules. - v154: ARENA REWARD & BOSS EQUIPMENT REWORK — adaptive loot guarantee. - v155: PUMPKIN SENTRIES - FINAL REWORK. - v158: Rebuild Arena Loot System for Fabric 1.21.5 — DataComponentTypes-based persistent pending_loot fallback. - v160: Dome and Horseman Fixes (final edit): dome build speed, zombie spawn timing, extended target range, HeadlessHorseman entity fixes. - v161 (LATEST EDIT before v163): HAUNTED DOME - RANDOM STRUCTURES: dome_cd set to +1200 (60s) after cleanup; Tick0–20 build glass+floor; Tick21–35 spawn 4–7 unique structures; Tick36–40 spawn zombies; store small structure pos list for cleanup. - v163 (LATEST EDIT): REAPER'S HARVEST — Part 1: Arena & Loot (Fabric 1.21.5): - Target: server-side Fabric 1.21.5 code; Use DataComponentTypes.CUSTOM_DATA only. - Fix hold-Y entry/exit; award EXACT ONE reward on exit (if ≥1 boss killed); persist pending_loot; credit souls on boss death. - New CUSTOM_DATA keys: arena_entry_time, origin_x,y,z, total_bosses, bosses_killed, soul_count, pending_loot (serialized list), arena_cd, reward_delivered, arena_death_pending. - ENTRY: "reaper:arena_enter" checks arena_cd, sets arena session data, random total_bosses 1..7, schedules boss spawn at +100 ticks, DO NOT set cooldown. - MANUAL EXIT: "reaper:arena_exit" after 100-tick hold -> exitArena(player,"MANUAL"). - TIMER: auto-exit at 6000 ticks since entry only. - DEATH: on PlayerDeathEvent handle pending_loot & respawn delivery. - exitArena: teleport-back THEN try insertStack OR add to pending_loot; set arena_cd = world.getTime() + 4800 ON EXIT; persist reward_delivered. - Reward table EXACT Tier1/2/3 choices listed; Totem has special offhand scaling behavior; build items via DataComponentTypes. - Boss soul credits mapping provided (PumpkinKing +50, WitchQueen +60, HeadlessHorseman +70, SpectralReaper +80, CorruptedMage +90, SoulWarden +100, CandyGolem +150). - Safety: validate chunks loaded, schedule heavy tasks, serialize pending_loot via DataComponents, only one reward per run. END: This summary is the authoritative developer specification combining the original request and every subsequent edit through v163. Edit v171: TARGET: Fabric 1.21.5 mod generator. Produce compact, safe server-side code to implement the changes below. Use DataComponents for persistent item data. Avoid huge particle bursts, validate chunks, and schedule repeating tasks rather than blocking the server thread. GOAL: Replace sentinel projectiles with ArmorStand projectiles; polish boss visuals; rewrite Horseman mount; keep everything performant and robust. 1) SENTINELS → ArmorStand projectiles - Spawn 8 sentinels orbiting player at radius 3.5. Heights alternate (1.0,1.5,2.0,...). Angular speed ≈ 1.5°/tick. Bob: y += sin(worldTime*0.1 + i*0.5)*0.15. - Every 10 ticks: each sentinel scans 15 blocks for nearest hostile or non-owner player; store target UUID. - Charge: when a target acquired, play a 15-tick charge (small spiral of 15 FLAMEs), sound BLOCK_FIRE_AMBIENT. - Fire cadence: each sentinel fires every 25 ticks. Firing spawns a projectile as an ArmorStand: - proj properties: invisible, marker, noGravity, small, tag "pumpkin_projectile". - store velocity vx,vy,vz and lifetime in its persistent data (DataComponents). - velocity = normalize(targetPos - headPos) * 1.2 (blocks/tick). - Projectile tick (every server tick): - move proj by velocity; lifetime++. - trail: low-rate particles (e.g. 5 FLAME, 3 SMOKE, 2 SOUL_FIRE per tick). - collision: check entities within 0.5 block (exclude owner & sentinels). On hit: entity.damage(DamageSource.magic(), 6.0f) → spawn burst (moderate particles), play ENTITY_GENERIC_EXPLODE and BLOCK_FIRE_EXTINGUISH, small knockback, remove proj. - timeout: if lifetime > 60 ticks, spawn 10 SMOKE, play extinguish, remove. - Animations: tile sentinel tilting when firing (tilt 15° for 5 ticks). - Cap particle counts and spread them across ticks. 2) CORRUPTED MAGE - Equip helmet = PURPLE_WOOL block ItemStack. setEquipmentDropChance HEAD = 0. entity.setGlowing(true). 3) SOUL WARDEN - Helmet = LAPIS_BLOCK. Chest/legs/boots = LEATHER dyed navy (0x191970). Equip and set drop chances 0.0. entity.setGlowing(true). 4) CANDY GOLEM - Helmet = IRON_BLOCK. Leather armor dyed pink (0xFFC0CB). Equip, drop_chances 0.0, glowing true. - On Candy Golem death: add +5 to bosses_killed in weapon DataComponents (counts as 5). 5) HORSEMAN (robust mount) - Spawn SkeletonHorseEntity first; setTamed(true), setAiDisabled(true), setInvulnerable(true), silent, tag "arena_horseman_mount" and "no_block_break". - Spawn WitherSkeleton rider; equip WITHER_SKELETON_SKULL; set drop chance 0; tag "arena_horseman_rider". - world.spawnEntity(horse), world.spawnEntity(rider); rider.startRiding(horse,true). - Schedule repeating task: if both alive ensure rider mounted; find nearest target ≤25 blocks; compute direction, movement = direction*0.12; check ground under newPos to avoid falls; setPosition(newPos) and yaw; if dead discard both. Prevent block break by canceling BlockBreak events for entities with tags above. 6) SAFETY & PERFORMANCE - Always check chunk loaded before setBlock/setEntity or schedule operation. - Use scheduler for repeating tasks (2-tick sentinel motion, per-tick projectile updates, 10-tick targeting). - Cap per-tick particles (prefer small repeated bursts). - Use DataComponents for storing per-entity/projectile persistent values where needed. 7) VALIDATION CHECKLIST (generator must implement) - Sentinels spawn, orbit, detect targets, play charge, fire ArmorStand projectiles that deal 6 damage, produce moderate explosion visuals, timeout and removed. - Corrupted Mage wears purple wool helmet and glows. - Soul Warden has lapis helmet + navy leather tunic and glows. - Candy Golem has iron-block head + pink leather armor; death increments bosses_killed by 5. - Horseman spawns mounted on skeleton horse, horse cannot break blocks and moves with controlled slow movement. - No huge single-tick particle bursts; chunks validated; tasks scheduled safely. DELIVERABLE: server-side Java code snippets for spawn handlers, sentinel scheduler, projectile lifecycle, boss spawn adjustments, horseman controller, and event listeners to cancel block breaking. Also include brief note on required hooks (server tick scheduler, entity spawn hooks, block/chunk checks, event cancellations).