345 downloads





Description:
🌌 ADVANCED SPAWNER ─ Universal Mob Foundry (UMF) │ ├─ ⚙️ Main Functionality: │ ├─ 🧟♂️ Automatically spawns mobs that YOU purchase from the spawner menu │ ├─ 💎 Generates and collects mob loot over time directly inside the block │ └─ 📦 Works as a full simulation block — spawn + loot + storage all-in-one │ ├─ 💰 Mob Purchasing System: │ ├─ 🛒 Buy mobs directly inside the spawner interface │ ├─ ⏳ Each mob produces drops over time as if naturally spawned │ └─ 🧺 All loot is automatically stored inside the spawner’s inventory │ ├─ ⬆️ Upgrade System (Level 1 ➜ 15): │ ├─ 🔓 Unlock higher rarities as you upgrade: │ │ ▪️ Common │ │ ▪️ Uncommon │ │ ▪️ Rare │ │ ▪️ Epic │ │ ▪️ Legendary │ │ ▪️ Mythic │ ├─ ⚡ Spawn Speed Boost — up to ✖️3 faster at Level 15 │ ├─ 📦 Storage Expansion — more space for mob drops │ └─ 💥 Loot Multiplier — higher rarity = up to ✖️7–8 item drops │ ├─ ⛏️ Mining & Recovery: │ ├─ Requires at least an Iron Pickaxe to mine │ ├─ 💎 Diamond and Netherite mine it faster │ └─ ❌ Weaker tools or bare hands won’t drop the block │ ├─ 💾 Data & Persistence: │ ├─ 🧠 All settings, upgrades, and purchases are saved inside the block │ ├─ 🔄 Breaking and replacing keeps your progress intact │ └─ 🌍 Even after quitting or re-loading your world, everything is saved! │ └─ by klow :)
Manage versions and create new iterations of this mod.
This will create a new mod based on "Universal Mob Foundry" with your modifications. The original mod will remain unchanged and you'll be credited as the author of the remix.
345
Oct 10, 2025, 06:22 PM
User request: Top-Level Objective: - Deliver full Fabric 1.21.5 mod source + assets implementing "Advanced Spawner" mod with mod id/namespace universal-mob-foundry-4swppely. - Advanced Spawner item id MUST be exactly universal-mob-foundry-4swppely:advanced_spawner. - Provide full MOB LIST (exact entity IDs) and per-mob five-tier loot tables (COMMON/UNCOMMON/RARE/EPIC/LEGENDARY) and MYTHIC where specified; include PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) loot tables; apply v110 rebalance rules and document reconciliation. - Provide master item→rarity mapping (deduplicated from v54/v58) and final mapping file. - Implement server-authoritative architecture and DataComponents-based BlockEntity persistence with migration for legacy NBT (v61/v63). - Provide automated Fabric 1.21.5 multiplayer tests, full documentation (packet formats, PropertyDelegate mapping, BlockEntity NBT keys & mandated write/read order, GUI atlas & hitbox pixel map), reconciliation log and test reports. - Implement and document explicit replacements for removed wither-skeleton-head drops (Wither Rare and Wither Skeleton Epic) per v110/v111 with justification. Primary Deliverables (explicit files/paths & behaviors): - Full Fabric 1.21.5 mod source & assets implementing specified architecture & rules. - Per-mob loot table JSONs (PASSIVE v107, HOSTILE v108, BOSS/SPECIAL v109) rebalanced per v110; mappings tokens→exact Minecraft item IDs. - Master deduplicated item→rarity mapping (from v54/v58) and final mapping file. - Verbatim files & exact repo paths preserved (with backups per v101): - src/main/resources/data/universal-mob-foundry-4swppely/recipes/advanced_spawner.json — implement v100/v101/v103 changes; keep backups per v101 and include historical pre-v100 JSONs. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json — COPY verbatim (v60 REQUIRED). - src/main/resources/data/universal-mob-foundry-4swppely/advancements/recipes/misc/advanced_spawner.json — historically added (v104) then removed (v105). FINAL: DO NOT include advancement file. - data/universal-mob-foundry-4swppely/workbenches.json (if custom workbench linking used). - pack.mcmeta for datapack inclusion. - Final recipe placement per v101: data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json (singular "recipe" folder recommended) containing v103 final pattern (iron_block ring with emerald center) and result.id universal-mob-foundry-4swppely:advanced_spawner. Keep pre-v100 & v100 variants as backups per v101. - Automated Fabric 1.21.5 multiplayer tests covering break/place persistence, drop semantics, BUY/UPGRADE/CLAIM/MISC atomicity & race tests, GUI syncs, registry-aware ItemStack serialization, hologram cleanup, scissor/clipping & hitbox tests. - Full documentation & reconciliation log explaining applied version rules and why (explicitly note v96, v100/v101, v103, v104/v105, v106, v110, v111, v112, v113, v114). Final required explicit files/assertions: - fabric.mod.json id == "universal-mob-foundry-4swppely" and includes both "main" and "client". - Advanced Spawner item registered with exact Identifier "universal-mob-foundry-4swppely:advanced_spawner". - Final recipe JSON placed per v101 folder/format reflecting v103 pattern (iron_block ring with emerald center); result.id = universal-mob-foundry-4swppely:advanced_spawner. - universal_mob_foundry_4swppely.json copied verbatim into datapack (v60). - No advancement file for advanced_spawner present (v105 final). - Data Components migration implemented; legacy NBT migration tests pass. - Master loot mapping file (v54/v58) produced with duplicates removed and v107/v108/v109 loot included and v110 rebalance applied. - All documentation, tests, and reconciliation log delivered. - Implement and document explicit replacements for removed wither-skeleton-head drops per v110/v111. MANDATORY ARCHITECTURE & IMPLEMENTATION RULES (must follow exactly): - Server-authoritative only: C2S validated on server; server mutates BlockEntity + inventories atomically; server sends S2C syncs. - NEVER call world.getBlockEntity client-side; NEVER mutate BlockEntity client-side. - BlockEntity change flow: markDirty(); world.updateListeners(pos,state,state,3) or Block.NOTIFY_ALL; send BlockEntityUpdateS2CPacket + dedicated Sync/Refresh S2C packets for complex data. - ScreenHandler constructors must be client-safe: accept PacketByteBuf and fallback to SimpleInventory. Server opens via SimpleNamedScreenHandlerFactory writing BlockPos to PacketByteBuf. - PropertyDelegate for primitives ONLY; collections/unlocked set & selectedMob must be sent by dedicated S2C packets (SyncDataS2CPacket, UpgradeDataS2CPacket, MobUnlockedS2CPacket). - Use DataComponents.BLOCK_ENTITY_DATA and BE.saveCustomOnly(HolderLookup.Provider) for getCloneItemStack; BE.loadAdditional(CompoundTag, HolderLookup.Provider) for load. - Implement Data Components migration layer to read legacy NBT and write new component-based saves (v61/v63); include tests. - NEVER mutate BlockEntity client-side; collection sync via S2C only. - Null-check BlockEntity in ScreenHandler handlers; store BE reference server-side only via world.getBlockEntity(pos). - Always despawn hologram when block broken: HologramManager.removeHologramAt(pos) on onBroken and onStateReplaced. - Registry-aware ItemStack serialization everywhere: use stack.save(registryAccess, tag) and ItemStack.parse(registryAccess, tag).orElse(ItemStack.EMPTY). - DO NOT include BlockEntity Items array in dropped block item NBT. Drop inventory contents separately via Containers.dropContents(level,pos,inventory). Use DataComponents for clone/pickup metadata (exclude Items). - Validate ItemStacks before saving; clean duplicate keys; clamp sizes; replace invalid stacks with empty CompoundTag placeholder. - BE.saveCustomOnly / loadAdditional must use HolderLookup.Provider for registry-aware component serialization. Crafting Recipe — History, Rules & Final: - v60: universal_mob_foundry_4swppely.json must be copied verbatim into datapack. - v96: recipe historically made unlock-from-start (document). FINAL: craftable from start (no advancement). - v100: 1.21.5 compatibility: recipe result must use "result.id" instead of "result.item". - v101: keep old recipes folder as backup; create new singular data/.../recipe/ format; keep historical pre-v100 JSONs as backups. - v103 (definitive final): pattern = 3x3 iron_block ring with emerald center. Place in data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner; ensure datapack placement and backups. - v104: historically added advancement JSON for recipe; v105: completely removes advancement because craft known by default. FINAL: DO NOT include advancement file. - v106: reaffirm final: iron block ring with emerald center; craftable from start. - Backups: include historical recipe JSON(s) per v101 (pre-v100 and v100 variants). - v100/v101/v103/v104/v105/v106 reconciliation must be documented. Block Mining / Place / Break Behavior: - Hardness = 3.0f; tool must be suitable (tool.isSuitableFor + tier >= IRON); use tag fabric:needs_tool_level_2. Mining time ~ diamond ore; use diamond-ore sounds & particles. - If broken without suitable tool: destroyed without drop. On correct-tool break: block drops itself with BlockEntity metadata EXCEPT DO NOT include Items array in dropped block item NBT (v35/v36/v48). - Inventory contents dropped separately via Containers.dropContents(level,pos,inventory). - Dropped ItemStack must restore full state on place: timers, unlocked/purchased mobs, storage items (except Items array in dropped block NBT), toggles, level, UUID, display.Name/Lore, per-mob timers/metadata. - v24 mining crash fix: check state.isOf(this) before property access; wrap onStateReplaced/mining reads in try/catch. - v62 hologram removal on break. BlockEntity NBT / DataComponents — Keys & Mandated Write/Read Order: - Persisted keys and validation/clamping: unlockedMobs (List), purchasedMobs (List), selectedMob (String id), storageSlots & per-slot storageItems — Items array MUST NOT be included in dropped block item NBT. - Other persisted keys: timerProgress, upgradeLevel/level, shulkerMode/autoShulker/autoChest/autoDrop/autoOutput (boolean/byte), rarityPercentages (int array), speedMultiplier (float), slotsCount/storageSlots (int), uniqueUUID, display.Name, display.Lore, per-mob timers/metadata. - v14 mandated writeNbt/readNbt ORDER: write unlockedMobs, selectedMob, level (upgradeLevel), speedMultiplier, rarityBoosts, storageSlots; read must load in same order. - Use mutable collections (new ArrayList<>) not immutable List.of() (v13/v17). Validate NBT sizes/types and clamp limits. - v47 collectComponents pattern: safe primitives & lists for getCloneItemStack / DataComponents. Registry-Aware ItemStack Serialization & NBT Hygiene: - Always use registryAccess for ItemStack.save/parse to avoid "Missing id for entity" crashes (v29/v32). - DO NOT store Items array in clone/dropped ItemStack NBT (v34–v36/v48); use DataComponents.BLOCK_ENTITY_DATA via BE.saveCustomOnly(HolderLookup.Provider); BE.loadAdditional(CompoundTag, HolderLookup.Provider). - Implement migration layer (v61) to convert legacy NBT-based saves to Data Components; preserve backward compatibility while writing new component-based saves. Automatic Generation & Loot / Per-Mob Generation Rules: - SelectMobC2SPacket validated server-side starts continuous per-mob timers (persisted). On timer completion add generated item to storage, restart, stop when storage full. - Use inventory.setStack(slot,item); markDirty(); world.updateListeners(); send ScreenHandlerSlotUpdateS2CPacket for changed slots. - Loot tables per mob: five-tier mandatory. Base rarity distribution v2 authoritative: COMMON 60%, UNCOMMON 25%, RARE 10%, EPIC 4%, LEGENDARY 1%; later edits add Mythic & rebalance — document reconciliation choices and apply v110 rebalance. - Generation algorithm: choose rarity via spawner level & distribution; pick item from Map<MobType, Map<Rarity,List<ItemStack>>>; quantity rules: COMMON 1-10; UNCOMMON 1-15; RARE 1-5; EPIC/LEGENDARY/MYTHIC = 1 (non-stackables=1); scale with spawner level. - Rarity name/lore policy: v27 added rarity-colored name + lore; v97 removed rarity text from generated items (rarity shown only in GUI). Implementer must choose final behavior and document choice. - Per-mob generation times: v2 baseline authoritative unless overridden; boss timers long (ender_dragon example 900s) and reconcilable per v48/v110. Full Mob List (exact entity IDs required): - zombie, skeleton, spider, creeper, cow, pig, chicken, sheep, enderman, blaze, witch, ghast, iron_golem, villager, pillager, vindicator, evoker, wither_skeleton, guardian, elder_guardian, shulker, phantom, drowned, ravager, piglin_brute, hoglin, zoglin, warden, wither, ender_dragon, husk, stray, cave_spider, silverfish, bee, wolf, cat, ocelot, horse, donkey, mule, llama, trader_llama, panda, polar_bear, fox, dolphin, squid, glow_squid, cod, salmon, tropical_fish, pufferfish, axolotl, bat, parrot, rabbit, turtle, frog, tadpole, goat, allay, vex, strider. LOOT TABLES & v110/v111 Rebalance: - Implement PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) per-mob loot tables mapping tokens to exact Minecraft item IDs. - v110: rebalance by HP/attack/difficulty/role; adjust probabilities & quality; adjust Epic→Mythic changes; explicitly remove Wither Skeleton head from Wither Skeleton Epic and from Wither Rare (Wither boss). Implement explicit replacements and document replacement items & justification. - v111: reaffirm replacement of Wither Rare loot & Wither Skeleton Epic loot to remove heads; implement replacements consistently and document. - v114/v115: display rarity percentage lines with icons: - "✹ Common: <percentage>" - "✺ Uncommon: <percentage>" - "✽ Rare: <percentage>" - "✿ Legendary: <percentage>" - "❀ Mythic: <percentage>" — Mythic icon pink and Mythic percentage purple; exact hex codes must be documented. - Reconciliation log must list exact adjustments applied to each mob (particularly Wither/Wither Skeleton) and the replacements (item IDs and justification). Home Tab (Shop & Selection Behavior): - Shop lists ALL mobs. Each entry: icon (spawn eggs replace mob heads per v37), mob name, exactly 3 required item icons + quantities (v37 enforces exactly 3 item types per mob). - BUY button toggles mob to UNLOCKED; BUY server-validated and atomically consumes exactly-3-item cost. - Hover tooltip shows required items & player's current amounts; BUY atomically consumes all 3 items server-side. - Right-side: scrollbar & mob selector dropdown: defaults "None", lists unlocked mobs only. Selection via SelectMobC2SPacket validated server-side sets selectedMob & starts timers; persists. - Storage slots: initial 3; expand via upgrades up to 27 mapping specified (document chosen progression if reconciled). - CLAIM button: server-side atomic transfer to player inventory with full/partial checks and locking. - MAKE SHULKER / AUTO-SHULKER / AUTO-CHEST / AUTO-DROP / AUTO-OUTPUT behaviors defined with unlock levels & atomic transfer semantics. - v48: RARITY FILTER BUTTON replaces AUTO-CHEST and cycles Common→Mythic; generator skips rolled rarities below minRarityFilter. - GUI hitboxes must align with visuals; implement scissor clipping & pixel atlas; document chosen GUI variant. Upgrades Tab & Mechanics: - Levels 0–15 (start L0 per v35). UPGRADE server-side atomic: consume items, increment level. - Exact upgrade costs authoritative mapping: v3 authoritative unless reconciliation chooses v47/v48 alternatives — document choice. - Speed multipliers mapping authoritative (v3 unless v35 redesign): L1=1.1x … L15=3.0x (document chosen mapping). - Rarity percentage shifts authoritative mapping from v3 unless overridden; Mythic introduced later — reconcile & document. - Storage progression authoritative mapping included (L1:3; L2:6; L3:9; L4:12; L5:15; L7:18; L9:21; L11:24; L13:27). - Unlocks: MAKE SHULKER L7; AUTO OUTPUT/AUTO DROP L10. - Upgrades UI server-authoritative; sync via UpgradeDataS2CPacket. GUI Variants & Final Choice Rule: - Allowed final GUI variants: choose one of v4, v5, v6, v9, v10, v11, v13, v14 (v14 preferred) or a v17-like overhaul. Implementer picks one and documents chosen variant and any deviations. - Enforce scissor clipping & z-order & hitbox parity via GuiGraphics.enableScissor() for scroll areas (v31). - Provide pixel atlas & hitbox pixel map for chosen GUI. - v110/v111 GUI edits: - v110: INFORMATION page must visually match UPGRADES page (color palette, borders, layout). - v111: change ONLY the panel color on INFORMATION page to exactly match UPGRADES page panels (background & border), leave text/layout/shadows unchanged. Color Palette (authoritative v17/v18 & rarity color rules): - BG(15,15,18), Panel(22,25,30), Element(28,32,38), Border(42,46,52), White(245,248,252), Gray(140,145,155), Green(80,170,95), Unlocked(45,130,80), Purple(140,110,200), Gold(210,150,50). - Rarity colors enumerated; v27 adds Mythic styling. - v114: Mythic icon color pink and Mythic percentage color purple — exact hex codes must be documented in final deliverable. - Final lore color format required by v117 (legacy § codes) is provided and must be implemented in output tooltips/GUI. Network / Client-Server Packets & Protocol: - ClientModInitializer required; fabric.mod.json must include "main" and "client". - Mandatory C2S packets: UpgradeRequestC2SPacket, BuyMobC2SPacket, SelectMobC2SPacket, ClaimC2SPacket, MakeShulkerC2SPacket, ToggleAutoC2SPacket. - S2C packets: UnlockedMobsSyncS2CPacket, MobUnlockedS2CPacket, UpgradeDataS2CPacket, SyncDataS2CPacket, RefreshGuiS2CPacket. - PropertyDelegate indices (v18): 0: level; 1–5: rarity percentages; 6: speedMultiplier*100 (int); 7: storage slots count; 8–27: unlocked bitfield (or send as packet). - After unlock: send MobUnlockedS2CPacket and client must refresh GUI via clearAndInit()/updateUnlockedMobs() on client thread. - Packet formats with field types & order must be documented exactly. Stability & Implementation Directives: - Server-side atomic inventory checks/removal for purchases/upgrades before committing and syncing. Validate slot indices and container sync parity; use 0-based indexing. - After server-side NBT changes call markDirty(); world.updateListeners(..., Block.NOTIFY_ALL); send BlockEntityUpdateS2CPacket + Sync/Refresh S2C packets. - SFX/particles per state; high-rarity generation plays special sound & particles. - GuiGraphics.enableScissor() for scroll areas; strict render bounds and z-order. - Provide automated Fabric 1.21.5 multiplayer tests (explicit list below). Make Shulker / Auto Behaviors: - MAKE SHULKER: unlock L7; togglable; creates filled shulker_box with content NBT and atomic transfer to player. - AUTO OUTPUT: unlock L10; outputs items to block at (x+1) server-side. - AUTO-CHEST: simulate chest placement/fill behavior (v33). - AUTO-DROP: when ON and all slots full, drops ALL contents at x+1 as ItemEntities and clears inventory (v48). - v48: RARITY FILTER replaces AUTO-CHEST; cycles Common→Mythic and generator skips rolled rarities below minRarityFilter. Lore / Dropped Item Display / Dynamic Tooltip: - display.Name: Format per v112/v113/v114. en_us translation required. - display.Lore persists across drop/place except Items array removal. - appendTooltip reads NBT for live values (Level, Selected, Unlocked, Storage, Speed, rarity percents), color-coded per brightness rule in v112. - v27 added rarity lore for generated items; v97 removed rarity text from generated items; implementer chooses final behavior and documents choice. - v112: ITEM NAME = gradient composition "Advanced Spawner [Lvl X]" using Component.literal fragments with specified hex colors & bold flags; set via DataComponents.CUSTOM_NAME in collectImplicitComponents(). LORE cleaned and stored via DataComponents.LORE; remove duplicate title lines & technical component text. - v113: LORE rarity icons changed to glyphs: "✹ Common...", "✺ Uncommon...", "✽ Rare...", "✿ Legendary...", "❀ Mythic...". FINAL legacy-style item name string must be "&A&lAd&2&lva&l3lnc&9&led &8&lSpa&7&lwn&F&ler &F&l[Lvl {level}]" (implement via DataComponents.CUSTOM_NAME with conversion/compatibility). - v114/v115: Rarity percentage display lines must be shown with icons and percentages as listed; Mythic icon pink and Mythic percentage text purple; use colons instead of ellipses. NBT Serialization Critical Pattern & Migration: - Use registryAccess for ItemStack save/parse everywhere. - DO NOT store Items array in clone ItemStack NBT; use DataComponents.BLOCK_ENTITY_DATA with clean tag via BE.saveCustomOnly(HolderLookup.Provider). BE.loadAdditional(CompoundTag, HolderLookup.Provider). - v61: implement migration layer converting legacy NBT to Data Components; keep legacy readNbt for conversion, then write new saves exclusively with components via addComponents()/readComponents(); include tests and migration explanation. Implementation Checklist (prioritized): 1. DataComponents pattern & migration layer (v48 & v61); tests place->break->place persistence. 2. Fix drop semantics: remove Items array from clone/dropped ItemStack NBT; drop inventory contents separately; attach minimal DataComponents payload via BLOCK_ENTITY_DATA. 3. Use registry-aware ItemStack.save/parse across codebase. 4. Server-authoritative atomic ops for BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO actions; locking & race tests. 5. Full five-tier loot tables for full mob list; produce master mapping (v54/v58) and rebalances per v110. 6. Home tab: shop UI (spawn egg icons per v37), BUY C2S -> server validate -> unlock -> MobUnlockedS2CPacket -> client refresh; SelectMobC2SPacket starts timers. 7. Storage expansion mapping, CLAIM, MAKE SHULKER/AUTO-CHEST (rarity filter)/AUTO-DROP server-atomic. 8. Upgrades tab L0–L15 with costs & multipliers; document chosen authoritative mapping if conflicts. 9. ScreenHandler & Screen client-safe constructors (PacketByteBuf fallback); never call BE on client. 10. SyncDataS2CPacket / RefreshGuiS2CPacket flows on GUI open & after changes; client updates handler & calls screen.clearAndInit() on client thread. 11. SFX/particles, spawn-egg shop icons, translations. 12. Automated test suite and reports. 13. fabric.mod.json id equals "universal-mob-foundry-4swppely" and includes both "main" and "client"; register Advanced Spawner item with exact Identifier. Conflicts & Reconciliation Rules: - Authoritative precedence: (1) v2 per-mob times, (2) v3 upgrades/costs/multipliers/rarity-breakpoints/storage mapping, (3) v14/v16/v17 NBT & network mandates. - Later edits (v18–v48+) must not violate authoritative mechanics. Where conflicts exist, preserve authoritative constraints; apply NBT/stability fixes as highest priority; document reconciliation decisions in reconciliation log. Chronological Highlights (one-line per notable version — include reconciliation-note usage): - v1: Original block, crafting, HOME shop ALL mobs, 3 storage slots, basic CLAIM & MAKE SHULKER/AUTO placeholders. - v2: Added per-mob timers, continuous generation, five-tier loot tables, base rarity 60/25/10/4/1 (authoritative for times & base rarities). - v3: Added UPGRADES 1–15, speed multipliers, rarity shift breakpoints, storage progression to 27; MAKE SHULKER L7 & AUTO OUTPUT L10 (authoritative for upgrades/storage/rarity breakpoints). - v4–v6: GUI sizes/bug fixes; server-side validation & atomic ops added. - v7–v9: Fabric 1.21.5 target reaffirmed, entrypoint fixes. - v10–v14: GUI overhauls; v14 enforces writeNbt/readNbt order and tooltip rules. - v16–v18: Recipe shaped JSON fixes; PropertyDelegate and packet protocol defined; client-safe ScreenHandler constructors mandated. - v19–v25: Crash fixes, mining enforcement, diamond-ore sound; slot update packets and hologram fixes. - v26–v31: UI scissor enforcement; NBT serialization cleaning. - v27: Rarity overhaul adds Mythic & colored lore (later mitigated). - v29/v32: Fix "Missing id for entity" via registry-aware ItemStack serialization. - v33: AUTO-SHULKER→AUTO-CHEST; AUTO-DROP clarified. - v34–v36: CRITICAL: DO NOT save Items array in dropped block item; drop via Containers.dropContents; Upgrades start at Level 0. - v37: Shop enforces 3-item costs; spawn eggs used as icons. - v38–v42: Loot table composition refined. - v45: UI polish & alignment fixes. - v47: UPGRADES reconstruction; collectComponents pattern for clone. - v48: CRITICAL DataComponents pattern established; DO NOT put Items into ItemStack NBT; hologram strictness; rarity filter introduced. - v53: Shop price updates. - v54 & v58: FIX RARITY DUPLICATES — produce master mapping and remove cross-tier duplicates (MANDATORY). - v57: Advanced Spawner recipe changed historically to CCC/INI/CCC (predecessor pattern; documented backup required). - v60: CRITICAL: include universal_mob_foundry_4swppely.json verbatim (datapack copy). - v61: Convert legacy NBT saving to Data Components; add migration layer. - v62–v63: Hologram removal & DataComponents persistence extensions; tests required. - v65–v73: GUI resize, procedural rules, per-level rarity distribution (Mythic in v73), GUI percent decimals. - v74–v82: Recipe rebuild enforcement; delete old recipes; add exact JSON at data/.../recipes/; v80/v82 removed unsupported fields; repackage & test. - v76: INFORMATION TAB added (live 3D model + loot/costs). - v83–v95: GUI/render/hitbox fixes, recipe troubleshooting, enforce registration & modid consistency, resource packaging checks. - v96: HISTORICAL EDIT: recipe unlocked from start (document). Final behavior: craftable from start. - v97–v99: Info page final fixes. - v100: FIX RECIPE PROBLEM — change "result.item" → "result.id" for 1.21.5 compatibility. - v101: Keep old recipes folder backup; create data/.../recipe/ (singular); preserve historical pre-v100 JSON. - v103: Definitive recipe change to iron_block ring with emerald center (supersedes prior patterns). - v104: Added advancement JSON historically and verified craft behavior (document; later removed). - v105: Remove advancement file (FINAL: no advancement included). - v106: Reinforce final: recipe craftable from start; treat as first-time mod. - v107: PASSIVE LOOT TABLES added/defined. - v108: HOSTILE LOOT TABLES added/defined. - v109: BOSS & SPECIAL LOOT TABLES added/defined. - v110: Rebalance all mob loot tables by HP/attack/difficulty/role; adjust probabilities/quality; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document. - v111: GUI: change only INFORMATION page panel color to match UPGRADES page panels; implement Wither head removal replacements. - v112: Advanced Spawner item NAME & LORE FIX: gradient name and lore cleaning via DataComponents in collectImplicitComponents(); remove duplicate title lines. - v113: LORE rarity icons to "✹/✺/✽/✿/❀" prefixes; FINAL legacy-style name string set to given ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must include icons and percentages as listed and ensure Mythic icon is pink and Mythic percentage text is purple (document exact colors). - v115: Replace "..." with ":" in all rarity lore lines and enforce Mythic icon pink + Mythic percentage purple. - v117: Rework Villager loot table: remove existing Legendary villager drops; add minecraft:emerald_block as Legendary + one additional villager item (implementer picks ID) with documented probabilities; Mythic tier limited to specified enchantments; provide JSON and numeric probabilities. - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates; other lore unchanged. - v119: Persistence & Sync Fix Request — Use Data Components for all persistent item/block data; copy components on place/pickup; hologram endTimestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder to plan, simplify on loops/errors, and finish tasks. - v123: Fix BlockEntity Data Persistence Bug — FULL directive to research & implement Data Components (NOT NBT) for BlockEntity persistence in Fabric 1.21.5; implement write/read equivalents, toUpdatePacket/toInitialChunkDataNbt, ensure hologram resumes and not frozen, ensure ItemStack↔BlockEntity component transfer on place/break, add markDirty() calls after each modification, do NOT use NBT-based solutions or outdated 1.19/1.20 methods; test persistence across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Hologram Bug: hologram not appearing after prior fix; mandated corrective behavior: spawn on place & load, resume timers, prevent duplicates by targeted duplicate detection/removal (not aggressive deletion), and include tests verifying single hologram, correct timer continuation, updates on selection changes. - v127: Information GUI LOOT panel enhancement: hover tooltip for loot icons showing full Item Name, full Item Lore (enchants and Mythic weapons), optional rarity, read dynamic NBT, support scrollable lists, match § formatting; also Block Mining Behavior change: mineable only with iron pickaxe+ to drop itself; wrong tool drops nothing; breaking speeds specified and tag needs_iron_tool applied. - v128: Procedural reminder to always plan; plus BUG: spawn egg icons wrong in GUI — diagnose mapping issue, fix icon retrieval for Home & Information pages, map mob id→correct spawn egg item, do not fallback to zombie egg, apply to both pages, test every mob; technical notes: check registry lookups, item stack creation for GUI icons, ensure 1.21.5 spawn egg registry names used (e.g., minecraft:dragon_spawn_egg for ender_dragon). Edits & Latest Directives Summary (actionable changes — one-line each): - v96: Document recipe historically unlocked-from-start; FINAL: craftable from start (no advancement). - v100: Change recipe JSON to use "result.id" for 1.21.5 compatibility. - v101: Move new recipe to data/.../recipe/ (singular) and keep old recipes folder as backup; include pre-v100 and v100 backups. - v103: Definitive recipe: iron_block ring with emerald center; place at data/.../recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner. - v104: Historically added advancement JSON for recipe (document). - v105: Remove advancement file; FINAL: do not include. - v106: Reaffirm craftable from start. - v107: Add PASSIVE loot tables. - v108: Add HOSTILE loot tables. - v109: Add BOSS/SPECIAL loot tables. - v110: Rebalance all loot tables by HP/difficulty/role; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document reasons. - v111: Change ONLY INFORMATION page panel color to match UPGRADES page panels; apply Wither head replacements. - v112: Implement Advanced Spawner item name gradient & clean lore via DataComponents in collectImplicitComponents(); avoid duplicate titles. - v113: Change lore rarity icons to "✹/✺/✽/✿/❀" and set final legacy-style name string to the given ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must be prefixed with icons and for Mythic use pink icon and purple percentage color. - v115: Plan before coding; on loops/errors simplify & retry; always finish the task. Replace "..." with ":" in all rarity lore; ensure Mythic icon pink and Mythic percentage purple. - v117: Villager loot rework (remove Legendary villager drops; add emerald_block + one villager item as Legendary with numeric probabilities; Mythic tier limited to specified enchantments; provide exact JSON, item IDs, probabilities). - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates. - v119: Persistence & Sync Fix Request — Data Components for all persistent data; copy components on place/pickup; hologram timestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder — plan, simplify on loops/errors, finish tasks. - v123: Fix BlockEntity Data Persistence Bug — research & implement Fabric 1.21.5 Data Components-based persistence for BlockEntity (NOT NBT), correct toUpdatePacket/toInitialChunkDataNbt, ensure ItemStack↔BlockEntity component transfers, markDirty() on changes, hologram resume, tests across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Hologram Bug: hologram not appearing after prior fix; mandated corrective behavior: spawn on place & load, resume timers, prevent duplicates by targeted duplicate detection/removal (not aggressive deletion), and include tests verifying single hologram, correct timer continuation, updates on selection changes. - v127: Add hover tooltips to LOOT panel items in INFORMATION GUI showing full item name, full lore/enchantments; Block Mining Behavior change: require iron+ pickaxe to drop, wrong tool yields nothing; breaking speeds specified. - v128: Always plan before coding. Fix Spawn Egg Icon bug: ensure correct spawn egg icons in Home & Information dropdowns; diagnose mapping, map mob id→correct spawn egg item, do not fallback to zombie egg, test every mob. v117 — Villager Loot Table Rework (detailed requirements): - Legendary Tier: - Remove all existing Legendary drops for villager. - Add minecraft:emerald_block as a Legendary drop (deliverable MUST document whether guaranteed OR "very rare"; if "very rare" provide exact probability). - Add one additional villager-representative Legendary item (implementer chooses exact item ID and documents justification & probability). - Provide numeric probabilities and balancing rationale (e.g., Legendary combined chance 0.5% with emerald_block 0.2% + villager-item 0.3% or alternate). - Mythic Tier: - Mythic tier includes ONLY these enchantments (as enchanted_book or pre-enchanted item): Efficiency V, Sharpness V, Protection IV, Mending, Unbreaking III, Looting III, Fortune III. - Implementer must choose form (enchanted_book vs pre-enchanted item), provide exact item IDs (e.g., minecraft:enchanted_book with stored_enchantments entries), and state exact probabilities per enchantment (extremely rare, rarer than Legendary). - Other Rarities (COMMON→EPIC): Keep unchanged. - Format & Display Requirements: - Mythic lines use "❀ Mythic: <percentage>" with pink icon and purple percentage color per v114/v115 and colons instead of ellipses. - Implementation specifics: - Provide exact JSON contents for villager loot JSON path under data/universal-mob-foundry-4swppely/loot_tables (or equivalent), including enchanted_book stored_enchantments if used. v118 — Spawner Lore Update (Rarity Format Only): - On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format: - §f§lRARITY: - §7§l✹ Common: §8§lX.X% - §a§l✺ Uncommon: §2§lX.X% - §9§l✽ Rare: §1§lX.X% - §6§l✿ Legendary: §4§lX.X% - §d§l❀ Mythic: §5§lX.X% - Replace X.X% with actual drop rates from applicable loot table; keep other lore lines unchanged. v119 — Persistence & Sync Fix Request (context, observed bugs, constraints, deliverables): - Context: BlockEntity loses selected mob, unlocked purchases, hologram state after leave/rejoin; hologram can freeze; unlocks/bought items disappear after relog while ItemStack persists. - Requirements & Constraints: - Use Data Components for all persistent item/block data (mobId, rarity, unlocked list, hologram remaining/end timestamp) with ComponentType + Codec. Avoid raw NBT set/get usage. - BlockEntity must persist to world save using proper BlockEntity serialization hooks and call markDirty()/request client update on change. - Sync full state to clients on chunk load and when state changes (BlockEntity update packet or minimal custom S2C packet). GUI must read authoritative state from server. - On place: copy ItemStack components → BlockEntity components. On break/pickup: write BlockEntity components → ItemStack components (same schema). - Hologram: store numeric progress (remainingTime or endTimestamp). On load, recompute remainingTime from saved timestamp and server time; update hologram each server tick and push diff updates to clients. - Use safe defaults/getOrDefault to avoid NPEs. Server validates purchases/unlocks; client is read-only view unless server confirms. - Deliverables: 1) Short patch/diff or minimal code snippets (where to edit and which methods to add/change). 2) Clear list of files/classes to change: BlockEntity, BlockItem, ScreenHandler, client Screen, network handler (explicit list). 3) Short test plan: explicit steps and expected results (place, buy, leave/rejoin, reload chunk, break & re-place). 4) Explanation of why Components are used and what to avoid (no raw NBT). Prefer codecs for lists/strings for the unlocked list, store mob IDs as registry keys/strings. v122 & Boss & Villager Mythic-Tier Enhancements: - Villager Mythic Loot: high-value enchanted books (Sharpness V, Efficiency V, Protection IV, Mending I, Unbreaking III, Fortune III, Looting III) extremely rare; trades configured correctly for 1.21.5. - Boss Mythic Weapons: deliver one "thematic" overpowered Mythic weapon per boss (Ender Dragon sword, Warden axe, Wither bow, Elder Guardian trident) with allowed vanilla enchantments only; provide JSONs and item IDs and ensure drops added alongside normal boss loot. Automated Fabric 1.21.5 Multiplayer Tests Required (explicit list): - Break/place NBT persistence: place->break->pickup->place restores timers/unlocked/purchased/selected/display/lore/UUID. - Drop semantics: verify dropped block ItemStack lacks Items array; inventory contents dropped separately; DataComponents.BLOCK_ENTITY_DATA present in clone. - BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO-OUTPUT/AUTO-DROP atomicity & race tests. - GUI sync flows & client clearAndInit() on MobUnlockedS2CPacket/SyncDataS2CPacket; ScreenHandler constructor uses PacketByteBuf fallback; no world.getBlockEntity client calls. - Registry-aware ItemStack.parse/save tests to avoid "Missing id for entity" crashes. - Hologram cleanup tests (remove on break). - Scissor/clipping & hitbox correctness tests. Documentation & Migration Deliverables: - Packet formats for all C2S & S2C packets with field types & exact order. - PropertyDelegate indices & usage (primitives only). - BlockEntity NBT write/read order and full list of required keys + validation/clamping rules. - GUI pixel atlas & hitbox map for chosen GUI variant; chosen GUI variant documented and justified. - Reconciliation log listing which version rules were applied and why; explicitly note v2/v3/v14/v48/v61 choices and final v96/v100/v101/v103/v104/v105/v106/v107/v108/v109/v110/v111/v112/v113/v114 decisions. - Data Components migration explanation, migration code, DataComponentType definitions, registry registration and tests proving conversion from legacy NBT to components. - Patch/diff snippets and file/class change list for v119/v123 persistent fixes. Important Verbatim / Backup Requirements: - Keep historical recipe JSON(s) as backups per v101 including pre-v100 shaped recipe JSON and v100 1.21.5-compatible JSON (result.id). - v101 folder change: final recipe JSON placed in data/.../recipe/ (singular) and keep old recipes folder as backup. - v60 universal_mob_foundry_4swppely.json MUST be copied verbatim into datapack. - DO NOT include historical advancement file in final project (v105). Document v104 test that added it and v105 removal decision. FINAL ASSERTIONS (must be true in final deliverable): - fabric.mod.json id == "universal-mob-foundry-4swppely"; includes "main" and "client". - Advanced Spawner item registered as "universal-mob-foundry-4swppely:advanced_spawner". - data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json exists with v103 iron_block ring + emerald center pattern and result.id universal-mob-foundry-4swppely:advanced_spawner. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json copied verbatim (v60). - No advancement file for advanced_spawner in final tree. - Historical recipe backups included per v101 (pre-v100, v100). - Data Components migration implemented and tests pass. - Master loot mapping file produced (v54/v58) with duplicates removed and v110 rebalance applied. - Per-mob loot JSONs for PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109) implemented and rebalanced per v110. - Wither & Wither Skeleton head removals implemented and replacements documented (v110/v111). - Automated Fabric 1.21.5 multiplayer tests implemented, executed, reports included. - Hologram duplicate-on-reload bug fixed (old hologram removed on BlockEntity init) and tested. - Upgrade progression rebalanced to exponential storage/speed curve and documented. - All code uses registry-aware ItemStack.save/parse, BE.saveCustomOnly(HolderLookup.Provider), BE.loadAdditional(CompoundTag, HolderLookup.Provider) as required. - All network packets documented exactly; PropertyDelegate indices applied; client constructors accept PacketByteBuf fallback. - Reconciliation log included listing every version decision and justification. v123 — Fix BlockEntity Data Persistence Bug (Fabric 1.21.5) — Mandatory Fix Requirements: - Implement proper BlockEntity serialization/deserialization using Data Components (research correct 1.21.5 API), ensure all spawner data persists: selected mob, unlocked list, generation timer/status. - Implement toUpdatePacket()/toInitialChunkDataNbt() correctly to sync clients on chunk load and ensure hologram displays update and resume (store endTimestamp and recompute remainingTime). - Ensure ItemStack→BlockEntity and BlockEntity→ItemStack component copying on place/break; onPlaced() reads ItemStack Components; break writes BlockEntity components back to clone ItemStack via BE.saveCustomOnly(HolderLookup.Provider). - Add markDirty() and send BlockEntityUpdateS2CPacket + Sync/Refresh S2C when data changes; use HolderLookup.Provider. - Tests: verify persistence across quit/rejoin (place, buy/unlock, select, upgrade, collect, quit, rejoin → all state restored), hologram resumes correct remaining time. Fix 2 Spawner Issues — Fabric 1.21.5 (latest actionable bug fixes): - BUG 1: Duplicate Hologram on World Reload — Fix: on BlockEntity load, despawn any existing hologram at the block position before spawning a fresh one; track holograms for removal; test multiple quit/rejoin → only one hologram. - BUG 2: Upgrade Progression Rebalancing (exponential growth) — Implement exponential storage & speed progression (Levels 0–15) with small early gains and large late-game rewards; map storage (3→30) and speed (1.0x→3.0x) with specified bands; use Data Components only; include tests. Automated Tests & Reports (deliverables): - Place->break->pickup->place persistence tests; dropped clone lacks Items array; atomicity & race tests; GUI sync & packet ordering tests; registry-aware ItemStack parse/save tests; hologram cleanup on break and reload; scissor/clipping & hitbox tests. Documentation deliverables: - Packet formats (fields & order), PropertyDelegate mapping, BlockEntity component schema, BE write/read order, HolderLookup.Provider usage. - Loot table JSONs, master rarity mapping JSON (deduped from v54/v58) and v110 adjustments. - Reconciliation log mapping versions → decisions (call out v2,v3,v14,v48,v61 and final choices). - Patch/diff snippets and file/class change list for v119/v123 persistence fixes. - GUI atlas & hitbox pixel map for chosen GUI variant; note v111 panel color adjustment. Strict Final Checklist (validate before delivery): - All FINAL ASSERTIONS above must be satisfied (fabric.mod.json, Advanced Spawner id, recipe location & content, verbatim datapack JSON v60, absence of advancement file, backups included, Data Components migration/tests, master loot mapping & v110 rebalance, per-mob loot JSONs v107/v108/v109, Wither replacements, automated tests & reports, hologram duplicate fix tested, exponential upgrade progression, registry-aware serialization, network packet docs, reconciliation log). v127 — Additional Feature: INFORMATION GUI LOOT PANEL TOOLTIP: - Add hover tooltip for every item icon in the INFORMATION -> LOOT panel (including scrollable lists). - Tooltip must display: full Item Name (colors/bold/icon), full Item Lore exactly as stored (enchanted books show all enchantments and levels formatted as item lore, Mythic weapons show custom lore/enchantments), optionally the rarity in color. - Tooltip must read item NBT dynamically (so it always reflects actual name/lore/enchantments). - Tooltip matches Minecraft formatting (§ codes allowed), is informational-only, and works in existing GUI. v127 — Additional Feature: Block Mining Behavior change: - Change block to be mineable only with iron pickaxe or higher to drop itself; wrong tool or bare hands drop nothing. - Breaking speed: - Bare hands ~3 seconds. - Iron pickaxe or better ~0.5–1.0 seconds. - Use standard Minecraft mining logic (mineable/pickaxe tag and needs_iron_tool tag). Keep same drop semantics and NBT/component rules otherwise. v128 — New directives (planning + Spawn Egg Icon bug fix): - Procedural reminder: always plan before coding; on loops/errors simplify & retry logically; finish tasks. - BUG: Wrong Spawn Egg Icons Displayed on Home Page & Information Page dropdowns: many mobs show zombie spawn egg icon instead of correct one (name correct, icon wrong). - Fix steps: 1. Diagnose mapping logic between mob IDs and spawn egg items; check registry lookups and fallback handling. 2. Fix icon retrieval: map each mob entity id to correct spawn egg item (use correct registry names, e.g., minecraft:ender_dragon → minecraft:dragon_spawn_egg). Do not default to zombie egg; if no egg, show no icon or specific unavailable icon. 3. Apply fix to Home Page and Information Page dropdowns and ensure dynamic updates when selection changes. 4. Test every mob icon to ensure correct egg displayed; verify GUI rendering code and ItemStack creation uses registry-aware lookups. - Technical notes: inspect item stack creation for GUI icons, mob type → spawn egg mapping, registry name mapping for 1.21.5. Deliverable Requirements Recap (actionable checklist for implementer): - Implement DataComponents-based BlockEntity persistence/migration per v61/v123; BE.saveCustomOnly(HolderLookup.Provider) & BE.loadAdditional(CompoundTag, HolderLookup.Provider); toUpdatePacket/toInitialChunkDataNbt fix; markDirty() & BlockEntityUpdateS2CPacket + Sync/Refresh S2C flows. - Implement server-authoritative packet handlers and S2C sync packets; document packet formats & field ordering. - Produce complete per-mob loot tables (v107/v108/v109) and master deduped mapping (v54/v58) and apply v110 rebalance, v111 Wither replacements, v117 villager rework, v122 boss Mythic weapons. - Implement home/shop/selection/claim/make-shulker/auto features server-atomically; enforce exactly-3-item purchase costs; selectMob starts timers server-side. - Implement GUI variant (choose and document) with scissor clipping, pixel atlas & hitbox map; apply v111 INFORMATION page panel color change; implement v127 LOOT hover tooltips reading item NBT. - Ensure clone item NBT excludes Items array; drop inventory contents separately; clone includes DataComponents.BLOCK_ENTITY_DATA only. - Keep all verbatim/backups per v60 & v101; place final recipe per v103; do NOT include recipe advancement file (v105). - Provide automated Fabric multiplayer test suite & reports covering all listed test cases. - Provide full documentation: reconciliation log (versions decisions), packet specs, BE component schema & read/write order, migration details, GUI atlas/hitbox, and list of files/classes changed (patch/diff). - Fix hologram duplication and hologram-not-appearing regressions per v126: targeted duplicate detection/removal, spawn on place/load, recompute remaining time from endTimestamp, resume timers, markDirty() & sync. - Rebalance upgrades to exponential progression (storage & speed) and document numeric curve. - Ensure registry-aware ItemStack serialization everywhere and NBT hygiene rules enforced. - Fix spawn egg icons bug in GUI per v128 and test all mob icons. - Final deliverable must pass all automated tests and meet the Strict Final Checklist. Edit v129: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. Modify the custom block so that when mined with an iron pickaxe or any stronger pickaxe (diamond, netherite), it breaks faster than with a weaker tool or by hand. Ensure that the mining speed scales correctly with the tool type and material.
1
Oct 10, 2025, 05:51 PM
User request: Top-Level Objective: - Deliver full Fabric 1.21.5 mod source + assets implementing an Advanced Spawner mod with mod id/namespace "universal-mob-foundry-4swppely". - Advanced Spawner item id MUST be exactly "universal-mob-foundry-4swppely:advanced_spawner". - Provide full MOB LIST (exact entity IDs) and per-mob five-tier loot tables (COMMON/UNCOMMON/RARE/EPIC/LEGENDARY) and MYTHIC where specified; include PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) loot tables; apply v110 rebalance rules and document reconciliation. - Provide master item→rarity mapping (deduplicated from v54/v58) and final mapping file. - Implement server-authoritative architecture and DataComponents-based BlockEntity persistence with migration for legacy NBT (v61/v63). - Provide automated Fabric 1.21.5 multiplayer tests, full documentation (packet formats, PropertyDelegate mapping, BlockEntity NBT keys & mandated write/read order, GUI atlas & hitbox pixel map), reconciliation log and test reports. - Implement and document explicit replacements for removed wither-skeleton-head drops (Wither Rare and Wither Skeleton Epic) per v110/v111 with justification. Primary Deliverables (explicit files/paths & behaviors): - Full Fabric 1.21.5 mod source & assets implementing specified architecture & rules. - Per-mob loot table JSONs for full MOB LIST rebalanced per v110: provide PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109). - Master deduplicated item→rarity mapping (from v54/v58) and final mapping file. - Verbatim files & exact repo paths preserved (with backups per v101): - src/main/resources/data/universal-mob-foundry-4swppely/recipes/advanced_spawner.json — implement v100/v101/v103 changes; keep backups per v101 and include historical pre-v100 JSONs. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json — COPY verbatim (v60 REQUIRED). - src/main/resources/data/universal-mob-foundry-4swppely/advancements/recipes/misc/advanced_spawner.json — historically added (v104) then removed (v105). FINAL: DO NOT include advancement file. - data/universal-mob-foundry-4swppely/workbenches.json (if custom workbench linking used). - pack.mcmeta for datapack inclusion. - Final recipe placement per v101: data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json (singular "recipe" folder recommended) containing v103 final pattern (iron_block ring with emerald center) and result.id universal-mob-foundry-4swppely:advanced_spawner. Keep pre-v100 & v100 variants as backups per v101. - Automated Fabric 1.21.5 multiplayer tests covering break/place persistence, drop semantics, BUY/UPGRADE/CLAIM/MISC atomicity & race tests, GUI syncs, registry-aware ItemStack serialization, hologram cleanup, scissor/clipping & hitbox tests. - Full documentation & reconciliation log explaining applied version rules and why (explicitly note v96, v100/v101, v103, v104/v105, v106, v110, v111, v112, v113, v114). Final required explicit files/assertions: - fabric.mod.json id == "universal-mob-foundry-4swppely" and includes both "main" and "client". - Advanced Spawner item registered with exact Identifier "universal-mob-foundry-4swppely:advanced_spawner". - Final recipe JSON placed per v101 folder/format reflecting v103 pattern (iron_block ring with emerald center); result.id = universal-mob-foundry-4swppely:advanced_spawner. - universal_mob_foundry_4swppely.json copied verbatim into datapack (v60). - No advancement file for advanced_spawner present (v105 final). - Data Components migration implemented; legacy NBT migration tests pass. - Master loot mapping file (v54/v58) produced with duplicates removed and v107/v108/v109 loot included and v110 rebalance applied. - All documentation, tests, and reconciliation log delivered. - Implement and document explicit replacements for removed wither-skeleton-head drops per v110/v111. MANDATORY ARCHITECTURE & IMPLEMENTATION RULES (must follow exactly): - Server-authoritative only: C2S validated on server; server mutates BlockEntity + inventories atomically; server sends S2C syncs. - NEVER call world.getBlockEntity client-side; NEVER mutate BlockEntity client-side. - BlockEntity change flow: markDirty(); world.updateListeners(pos,state,state,3) or Block.NOTIFY_ALL; send BlockEntityUpdateS2CPacket + dedicated Sync/Refresh S2C packets for complex data. - ScreenHandler constructors must be client-safe: accept PacketByteBuf and fallback to SimpleInventory. Server opens via SimpleNamedScreenHandlerFactory writing BlockPos to PacketByteBuf. - PropertyDelegate for primitives ONLY; collections/unlocked set & selectedMob must be sent by dedicated S2C packets (SyncDataS2CPacket, UpgradeDataS2CPacket, MobUnlockedS2CPacket). - Use DataComponents.BLOCK_ENTITY_DATA and BE.saveCustomOnly(HolderLookup.Provider) for getCloneItemStack; BE.loadAdditional(CompoundTag, HolderLookup.Provider) for load. - Implement Data Components migration layer to read legacy NBT and write new component-based saves (v61/v63); include tests. - NEVER mutate BlockEntity client-side; collection sync via S2C only. - Null-check BlockEntity in ScreenHandler handlers; store BE reference server-side only via world.getBlockEntity(pos). - Always despawn hologram when block broken: HologramManager.removeHologramAt(pos) on onBroken and onStateReplaced. - Registry-aware ItemStack serialization everywhere: use stack.save(registryAccess, tag) and ItemStack.parse(registryAccess, tag).orElse(ItemStack.EMPTY). - DO NOT include BlockEntity Items array in dropped block item NBT. Drop inventory contents separately via Containers.dropContents(level,pos,inventory). Use DataComponents for clone/pickup metadata (exclude Items). - Validate ItemStacks before saving; clean duplicate keys; clamp sizes; replace invalid stacks with empty CompoundTag placeholder. - BE.saveCustomOnly / loadAdditional must use HolderLookup.Provider for registry-aware component serialization. Crafting Recipe — History, Rules & Final: - v60: universal_mob_foundry_4swppely.json must be copied verbatim into datapack. - v96: recipe historically made unlock-from-start (document). FINAL: craftable from start (no advancement). - v100: 1.21.5 compatibility: recipe result must use "result.id" instead of "result.item". - v101: keep old recipes folder as backup; create new singular data/.../recipe/ format; keep historical pre-v100 JSONs as backups. - v103 (definitive final): pattern = 3x3 iron_block ring with emerald center. Place in data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner; ensure datapack placement and backups. - v104: historically added advancement JSON for recipe; v105: completely removes advancement because craft known by default. FINAL: DO NOT include advancement file. - v106: reaffirm final: iron block ring with emerald center; craftable from start. - Backups: include historical recipe JSON(s) per v101 (pre-v100 and v100 variants). - v100/v101/v103/v104/v105/v106 reconciliation must be documented. Block Mining / Place / Break Behavior: - Hardness = 3.0f; tool must be suitable (tool.isSuitableFor + tier >= IRON); use tag fabric:needs_tool_level_2. Mining time ~ diamond ore; use diamond-ore sounds & particles. - If broken without suitable tool: destroyed without drop. On correct-tool break: block drops itself with BlockEntity metadata EXCEPT DO NOT include Items array in dropped block item NBT (v35/v36/v48). - Inventory contents dropped separately via Containers.dropContents(level,pos,inventory). - Dropped ItemStack must restore full state on place: timers, unlocked/purchased mobs, storage items (except Items array in dropped block NBT), toggles, level, UUID, display.Name/Lore, per-mob timers/metadata. - v24 mining crash fix: check state.isOf(this) before property access; wrap onStateReplaced/mining reads in try/catch. - v62 hologram removal on break. BlockEntity NBT / DataComponents — Keys & Mandated Write/Read Order: - Persisted keys and validation/clamping: unlockedMobs (List), purchasedMobs (List), selectedMob (String id), storageSlots & per-slot storageItems — Items array MUST NOT be included in dropped block item NBT. - Other persisted keys: timerProgress, upgradeLevel/level, shulkerMode/autoShulker/autoChest/autoDrop/autoOutput (boolean/byte), rarityPercentages (int array), speedMultiplier (float), slotsCount/storageSlots (int), uniqueUUID, display.Name, display.Lore, per-mob timers/metadata. - v14 mandated writeNbt/readNbt ORDER: write unlockedMobs, selectedMob, level (upgradeLevel), speedMultiplier, rarityBoosts, storageSlots; read must load in same order. - Use mutable collections (new ArrayList<>) not immutable List.of() (v13/v17). Validate NBT sizes/types and clamp limits. - v47 collectComponents pattern: safe primitives & lists for getCloneItemStack / DataComponents. Registry-Aware ItemStack Serialization & NBT Hygiene: - Always use registryAccess for ItemStack.save/parse to avoid "Missing id for entity" crashes (v29/v32). - DO NOT store Items array in clone/dropped ItemStack NBT (v34–v36/v48); use DataComponents.BLOCK_ENTITY_DATA via BE.saveCustomOnly(HolderLookup.Provider); BE.loadAdditional(CompoundTag, HolderLookup.Provider). - Implement migration layer (v61) to convert legacy NBT-based saves to Data Components; preserve backward compatibility while writing new component-based saves. Automatic Generation & Loot / Per-Mob Generation Rules: - SelectMobC2SPacket validated server-side starts continuous per-mob timers (persisted). On timer completion add generated item to storage, restart, stop when storage full. - Use inventory.setStack(slot,item); markDirty(); world.updateListeners(); send ScreenHandlerSlotUpdateS2CPacket for changed slots. - Loot tables per mob: five-tier mandatory. Base rarity distribution v2 authoritative: COMMON 60%, UNCOMMON 25%, RARE 10%, EPIC 4%, LEGENDARY 1%; later edits add Mythic & rebalance — document reconciliation choices and apply v110 rebalance. - Generation algorithm: choose rarity via spawner level & distribution; pick item from Map<MobType, Map<Rarity,List<ItemStack>>>; quantity rules: COMMON 1-10; UNCOMMON 1-15; RARE 1-5; EPIC/LEGENDARY/MYTHIC = 1 (non-stackables=1); scale with spawner level. - Rarity name/lore policy: v27 added rarity-colored name + lore; v97 removed rarity text from generated items (rarity shown only in GUI). Implementer must choose final behavior and document choice. - Per-mob generation times: v2 baseline authoritative unless overridden; boss timers long (ender_dragon example 900s) and reconcilable per v48/v110. Full Mob List (exact entity IDs required): - zombie, skeleton, spider, creeper, cow, pig, chicken, sheep, enderman, blaze, witch, ghast, iron_golem, villager, pillager, vindicator, evoker, wither_skeleton, guardian, elder_guardian, shulker, phantom, drowned, ravager, piglin_brute, hoglin, zoglin, warden, wither, ender_dragon, husk, stray, cave_spider, silverfish, bee, wolf, cat, ocelot, horse, donkey, mule, llama, trader_llama, panda, polar_bear, fox, dolphin, squid, glow_squid, cod, salmon, tropical_fish, pufferfish, axolotl, bat, parrot, rabbit, turtle, frog, tadpole, goat, allay, vex, strider. LOOT TABLES & v110/v111 Rebalance: - Implement PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) per-mob loot tables mapping tokens to exact Minecraft item IDs. - v110: rebalance by HP/attack/difficulty/role; adjust probabilities & quality; adjust Epic→Mythic changes; explicitly remove Wither Skeleton head from Wither Skeleton Epic and from Wither Rare (Wither boss). Implement explicit replacements and document replacement items & justification. - v111: reaffirm replacement of Wither Rare loot & Wither Skeleton Epic loot to remove heads; implement replacements consistently and document. - v114/v115: display rarity percentage lines with icons: - "✹ Common: <percentage>" - "✺ Uncommon: <percentage>" - "✽ Rare: <percentage>" - "✿ Legendary: <percentage>" - "❀ Mythic: <percentage>" — Mythic icon pink and Mythic percentage purple; exact hex codes must be documented. - Reconciliation log must list exact adjustments applied to each mob (particularly Wither/Wither Skeleton) and the replacements (item IDs and justification). Home Tab (Shop & Selection Behavior): - Shop lists ALL mobs. Each entry: icon (spawn eggs replace mob heads per v37), mob name, exactly 3 required item icons + quantities (v37 enforces exactly 3 item types per mob). - BUY button toggles mob to UNLOCKED; BUY server-validated and atomically consumes exactly-3-item cost. - Hover tooltip shows required items & player's current amounts; BUY atomically consumes all 3 items server-side. - Right-side: scrollbar & mob selector dropdown: defaults "None", lists unlocked mobs only. Selection via SelectMobC2SPacket validated server-side sets selectedMob & starts timers; persists. - Storage slots: initial 3; expand via upgrades up to 27 mapping specified (document chosen progression if reconciled). - CLAIM button: server-side atomic transfer to player inventory with full/partial checks and locking. - MAKE SHULKER / AUTO-SHULKER / AUTO-CHEST / AUTO-DROP / AUTO-OUTPUT behaviors defined with unlock levels & atomic transfer semantics. - v48: RARITY FILTER BUTTON replaces AUTO-CHEST and cycles Common→Mythic; generator skips rolled rarities below minRarityFilter. - GUI hitboxes must align with visuals; implement scissor clipping & pixel atlas; document chosen GUI variant. Upgrades Tab & Mechanics: - Levels 0–15 (start L0 per v35). UPGRADE server-side atomic: consume items, increment level. - Exact upgrade costs authoritative mapping: v3 authoritative unless reconciliation chooses v47/v48 alternatives — document choice. - Speed multipliers mapping authoritative (v3 unless v35 redesign): L1=1.1x … L15=3.0x (document chosen mapping). - Rarity percentage shifts authoritative mapping from v3 unless overridden; Mythic introduced later — reconcile & document. - Storage progression authoritative mapping included (L1:3; L2:6; L3:9; L4:12; L5:15; L7:18; L9:21; L11:24; L13:27). - Unlocks: MAKE SHULKER L7; AUTO OUTPUT/AUTO DROP L10. - Upgrades UI server-authoritative; sync via UpgradeDataS2CPacket. GUI Variants & Final Choice Rule: - Allowed final GUI variants: choose one of v4, v5, v6, v9, v10, v11, v13, v14 (v14 preferred) or a v17-like overhaul. Implementer picks one and documents chosen variant and any deviations. - Enforce scissor clipping & z-order & hitbox parity via GuiGraphics.enableScissor() for scroll areas (v31). - Provide pixel atlas & hitbox pixel map for chosen GUI. - v110/v111 GUI edits: - v110: INFORMATION page must visually match UPGRADES page (color palette, borders, layout). - v111: change ONLY the panel color on INFORMATION page to exactly match UPGRADES page panels (background & border), leave text/layout/shadows unchanged. Color Palette (authoritative v17/v18 & rarity color rules): - BG(15,15,18), Panel(22,25,30), Element(28,32,38), Border(42,46,52), White(245,248,252), Gray(140,145,155), Green(80,170,95), Unlocked(45,130,80), Purple(140,110,200), Gold(210,150,50). - Rarity colors enumerated; v27 adds Mythic styling. - v114: Mythic icon color pink and Mythic percentage color purple — exact hex codes must be documented in final deliverable. - Final lore color format required by v117 (legacy § codes) is provided and must be implemented in output tooltips/GUI. Network / Client-Server Packets & Protocol: - ClientModInitializer required; fabric.mod.json must include "main" and "client". - Mandatory C2S packets: UpgradeRequestC2SPacket, BuyMobC2SPacket, SelectMobC2SPacket, ClaimC2SPacket, MakeShulkerC2SPacket, ToggleAutoC2SPacket. - S2C packets: UnlockedMobsSyncS2CPacket, MobUnlockedS2CPacket, UpgradeDataS2CPacket, SyncDataS2CPacket, RefreshGuiS2CPacket. - PropertyDelegate indices (v18): 0: level; 1–5: rarity percentages; 6: speedMultiplier*100 (int); 7: storage slots count; 8–27: unlocked bitfield (or send as packet). - After unlock: send MobUnlockedS2CPacket and client must refresh GUI via clearAndInit()/updateUnlockedMobs() on client thread. - Packet formats with field types & order must be documented exactly. Stability & Implementation Directives: - Server-side atomic inventory checks/removal for purchases/upgrades before committing and syncing. Validate slot indices and container sync parity; use 0-based indexing. - After server-side NBT changes call markDirty(); world.updateListeners(..., Block.NOTIFY_ALL); send BlockEntityUpdateS2CPacket + Sync/Refresh S2C packets. - SFX/particles per state; high-rarity generation plays special sound & particles. - GuiGraphics.enableScissor() for scroll areas; strict render bounds and z-order. - Provide automated Fabric 1.21.5 multiplayer tests (explicit list below). Make Shulker / Auto Behaviors: - MAKE SHULKER: unlock L7; togglable; creates filled shulker_box with content NBT and atomic transfer to player. - AUTO OUTPUT: unlock L10; outputs items to block at (x+1) server-side. - AUTO-CHEST: simulate chest placement/fill behavior (v33). - AUTO-DROP: when ON and all slots full, drops ALL contents at x+1 as ItemEntities and clears inventory (v48). - v48: RARITY FILTER replaces AUTO-CHEST; cycles Common→Mythic and generator skips rolled rarities below minRarityFilter. Lore / Dropped Item Display / Dynamic Tooltip: - display.Name: Format per v112/v113/v114. en_us translation required. - display.Lore persists across drop/place except Items array removal. - appendTooltip reads NBT for live values (Level, Selected, Unlocked, Storage, Speed, rarity percents), color-coded per brightness rule in v112. - v27 added rarity lore for generated items; v97 removed rarity text from generated items; implementer chooses final behavior and documents choice. - v112: ITEM NAME = gradient composition "Advanced Spawner [Lvl X]" using Component.literal fragments with specified hex colors & bold flags; set via DataComponents.CUSTOM_NAME in collectImplicitComponents(). LORE cleaned and stored via DataComponents.LORE; remove duplicate title lines & technical component text. - v113: LORE rarity icons changed to glyphs: "✹ Common...", "✺ Uncommon...", "✽ Rare...", "✿ Legendary...", "❀ Mythic...". FINAL legacy-style item name string must be "&A&lAd&2&lva&l3lnc&9&led &8&lSpa&7&lwn&F&ler &F&l[Lvl {level}]" (implement via DataComponents.CUSTOM_NAME with conversion/compatibility). - v114/v115: Rarity percentage display lines must be shown with icons and percentages as listed; Mythic icon pink and Mythic percentage text purple; use colons instead of ellipses. NBT Serialization Critical Pattern & Migration: - Use registryAccess for ItemStack save/parse everywhere. - DO NOT store Items array in clone ItemStack NBT; use DataComponents.BLOCK_ENTITY_DATA with clean tag via BE.saveCustomOnly(HolderLookup.Provider). BE.loadAdditional(CompoundTag, HolderLookup.Provider). - v61: implement migration layer converting legacy NBT to Data Components; keep legacy readNbt for conversion, then write new saves exclusively with components via addComponents()/readComponents(); include tests and migration explanation. Implementation Checklist (prioritized): 1. DataComponents pattern & migration layer (v48 & v61); tests place->break->place persistence. 2. Fix drop semantics: remove Items array from clone/dropped ItemStack NBT; drop inventory contents separately; attach minimal DataComponents payload via BLOCK_ENTITY_DATA. 3. Use registry-aware ItemStack.save/parse across codebase. 4. Server-authoritative atomic ops for BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO actions; locking & race tests. 5. Full five-tier loot tables for full mob list; produce master mapping (v54/v58) and rebalances per v110. 6. Home tab: shop UI (spawn egg icons per v37), BUY C2S -> server validate -> unlock -> MobUnlockedS2CPacket -> client refresh; SelectMobC2SPacket starts timers. 7. Storage expansion mapping, CLAIM, MAKE SHULKER/AUTO-CHEST (rarity filter)/AUTO-DROP server-atomic. 8. Upgrades tab L0–L15 with costs & multipliers; document chosen authoritative mapping if conflicts. 9. ScreenHandler & Screen client-safe constructors (PacketByteBuf fallback); never call BE on client. 10. SyncDataS2CPacket / RefreshGuiS2CPacket flows on GUI open & after changes; client updates handler & calls screen.clearAndInit() on client thread. 11. SFX/particles, spawn-egg shop icons, translations. 12. Automated test suite and reports. 13. fabric.mod.json id equals "universal-mob-foundry-4swppely" and includes both "main" and "client"; register Advanced Spawner item with exact Identifier. Conflicts & Reconciliation Rules: - Authoritative precedence: (1) v2 per-mob times, (2) v3 upgrades/costs/multipliers/rarity-breakpoints/storage mapping, (3) v14/v16/v17 NBT & network mandates. - Later edits (v18–v48+) must not violate authoritative mechanics. Where conflicts exist, preserve authoritative constraints; apply NBT/stability fixes as highest priority; document reconciliation decisions in reconciliation log. Chronological Highlights (one-line per notable version — include reconciliation-note usage): - v1: Original block, crafting, HOME shop ALL mobs, 3 storage slots, basic CLAIM & MAKE SHULKER/AUTO placeholders. - v2: Added per-mob timers, continuous generation, five-tier loot tables, base rarity 60/25/10/4/1 (authoritative for times & base rarities). - v3: Added UPGRADES 1–15, speed multipliers, rarity shift breakpoints, storage progression to 27; MAKE SHULKER L7 & AUTO OUTPUT L10 (authoritative for upgrades/storage/rarity breakpoints). - v4–v6: GUI sizes/bug fixes; server-side validation & atomic ops added. - v7–v9: Fabric 1.21.5 target reaffirmed, entrypoint fixes. - v10–v14: GUI overhauls; v14 enforces writeNbt/readNbt order and tooltip rules. - v16–v18: Recipe shaped JSON fixes; PropertyDelegate and packet protocol defined; client-safe ScreenHandler constructors mandated. - v19–v25: Crash fixes, mining enforcement, diamond-ore sound; slot update packets and hologram fixes. - v26–v31: UI scissor enforcement; NBT serialization cleaning. - v27: Rarity overhaul adds Mythic & colored lore (later mitigated). - v29/v32: Fix "Missing id for entity" via registry-aware ItemStack serialization. - v33: AUTO-SHULKER→AUTO-CHEST; AUTO-DROP clarified. - v34–v36: CRITICAL: DO NOT save Items array in dropped block item; drop via Containers.dropContents; Upgrades start at Level 0. - v37: Shop enforces 3-item costs; spawn eggs used as icons. - v38–v42: Loot table composition refined. - v45: UI polish & alignment fixes. - v47: UPGRADES reconstruction; collectComponents pattern for clone. - v48: CRITICAL DataComponents pattern established; DO NOT put Items into ItemStack NBT; hologram strictness; rarity filter introduced. - v53: Shop price updates. - v54 & v58: FIX RARITY DUPLICATES — produce master mapping and remove cross-tier duplicates (MANDATORY). - v57: Advanced Spawner recipe changed historically to CCC/INI/CCC (predecessor pattern; documented backup required). - v60: CRITICAL: include universal_mob_foundry_4swppely.json verbatim (datapack copy). - v61: Convert legacy NBT saving to Data Components; add migration layer. - v62–v63: Hologram removal & DataComponents persistence extensions; tests required. - v65–v73: GUI resize, procedural rules, per-level rarity distribution (Mythic in v73), GUI percent decimals. - v74–v82: Recipe rebuild enforcement; delete old recipes; add exact JSON at data/.../recipes/; v80/v82 removed unsupported fields; repackage & test. - v76: INFORMATION TAB added (live 3D model + loot/costs). - v83–v95: GUI/render/hitbox fixes, recipe troubleshooting, enforce registration & modid consistency, resource packaging checks. - v96: HISTORICAL EDIT: recipe unlocked from start (document). Final behavior: craftable from start. - v97–v99: Info page final fixes. - v100: FIX RECIPE PROBLEM — change "result.item" → "result.id" for 1.21.5 compatibility. - v101: Keep old recipes folder backup; create data/.../recipe/ (singular); preserve historical pre-v100 JSON. - v103: Definitive recipe change to iron_block ring with emerald center (supersedes prior patterns). - v104: Added advancement JSON historically and verified craft behavior (document; later removed). - v105: Remove advancement file (FINAL: no advancement included). - v106: Reinforce final: recipe craftable from start; treat as first-time mod. - v107: PASSIVE LOOT TABLES added/defined. - v108: HOSTILE LOOT TABLES added/defined. - v109: BOSS & SPECIAL LOOT TABLES added/defined. - v110: Rebalance all mob loot tables by HP/attack/difficulty/role; adjust probabilities/quality; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document. - v111: GUI: change only INFORMATION page panel color to match UPGRADES page panels; implement Wither head removal replacements. - v112: Advanced Spawner item NAME & LORE FIX: gradient name and lore cleaning via DataComponents in collectImplicitComponents(); remove duplicate title lines. - v113: LORE rarity icons to "✹/✺/✽/✿/❀" prefixes; FINAL legacy-style item name string set to given ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must include icons and percentages as listed and ensure Mythic icon is pink and Mythic percentage text is purple (document exact colors). - v115: Replace "..." with ":" in all rarity lore lines and enforce Mythic icon pink + Mythic percentage purple. - v117: Rework Villager loot table: remove existing Legendary villager drops; add minecraft:emerald_block as Legendary + one additional villager item (implementer picks ID) with documented probabilities; Mythic tier limited to specified enchantments; provide JSON and numeric probabilities. - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates; other lore unchanged. - v119: Persistence & Sync Fix Request — Use Data Components for all persistent item/block data; copy components on place/pickup; hologram endTimestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder to plan, simplify on loops/errors, and finish tasks. - v123: Fix BlockEntity Data Persistence Bug — FULL directive to research & implement Data Components (NOT NBT) for BlockEntity persistence in Fabric 1.21.5; implement write/read equivalents, toUpdatePacket/toInitialChunkDataNbt, ensure hologram resumes and not frozen, ensure ItemStack↔BlockEntity component transfer on place/break, add markDirty() calls after each modification, do NOT use NBT-based solutions or outdated 1.19/1.20 methods; test persistence across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Hologram Bug: hologram not appearing after prior fix; mandated corrective behavior: spawn on place & load, resume timers, prevent duplicates by targeted duplicate detection/removal (not aggressive deletion), and include tests verifying single hologram, correct timer continuation, updates on selection changes. - v127: Information GUI LOOT panel enhancement: when hovering a loot item icon show a detailed tooltip containing full Item Name (with colors/bold/icon), full Item Lore (including enchanted books showing enchantments and Mythic weapons with custom lore/enchantments), optionally display rarity color-coded, tooltip must use § formatting and read dynamic NBT, work in existing GUI for all loot items including scrollable lists; tooltip is informational only. Edits & Latest Directives Summary (actionable changes — one-line each): - v96: Document historical recipe unlocked-from-start; FINAL: craftable from start (no advancement). - v100: Change recipe JSON to use "result.id" for 1.21.5 compatibility. - v101: Move new recipe to data/.../recipe/ (singular) and keep old recipes folder as backup; include pre-v100 and v100 backups. - v103: Definitive recipe: iron_block ring with emerald center; place at data/.../recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner. - v104: Historically added advancement JSON for recipe (document). - v105: Remove advancement file; FINAL: do not include. - v106: Reaffirm craftable from start. - v107: Add PASSIVE loot tables. - v108: Add HOSTILE loot tables. - v109: Add BOSS/SPECIAL loot tables. - v110: Rebalance all loot tables by HP/difficulty/role; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document reasons. - v111: Change ONLY INFORMATION page panel color to match UPGRADES page panels; apply Wither head replacements. - v112: Implement Advanced Spawner item name gradient & clean lore via DataComponents in collectImplicitComponents(); avoid duplicate titles. - v113: Change lore rarity icons to "✹/✺/✽/✿/❀" and set final legacy-style name string to the given ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must be prefixed with icons and for Mythic use pink icon and purple percentage color. - v115: Plan before coding; on loops/errors simplify & retry; always finish the task. Replace "..." with ":" in all rarity lore; ensure Mythic icon pink and Mythic percentage purple. - v117: Villager loot rework (remove Legendary villager drops; add emerald_block + one villager item as Legendary with numeric probabilities; Mythic tier limited to specified enchantments; provide exact JSON, item IDs, probabilities). - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates. - v119: Persistence & Sync Fix Request — Data Components for all persistent data; copy components on place/pickup; hologram timestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder — plan, simplify on loops/errors, finish tasks. - v123: Fix BlockEntity Data Persistence Bug — research & implement Fabric 1.21.5 Data Components-based persistence for BlockEntity (NOT NBT), correct toUpdatePacket/toInitialChunkDataNbt, ensure ItemStack↔BlockEntity component transfers, markDirty() on changes, hologram resume, tests across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Hologram Bug: hologram not appearing after prior fix; mandated corrective behavior: spawn on place & load, resume timers, prevent duplicates by targeted duplicate detection/removal (not aggressive deletion), and include tests verifying single hologram, correct timer continuation, updates on selection changes. - v127: Add hover tooltips to LOOT panel items in INFORMATION GUI showing full item name, full lore (enchants and Mythic weapons), optional rarity, read NBT dynamically, support scrollable lists, match Minecraft formatting (§ codes), informational-only. v117 — Villager Loot Table Rework (detailed requirements): - Legendary Tier: - Remove all existing Legendary drops for villager. - Add minecraft:emerald_block as a Legendary drop (deliverable MUST document whether guaranteed OR "very rare"; if "very rare" provide exact probability). - Add one additional villager-representative Legendary item (implementer chooses exact item ID and documents justification & probability). - Provide numeric probabilities and balancing rationale (e.g., Legendary combined chance 0.5% with emerald_block 0.2% + villager-item 0.3% or alternate). - Mythic Tier: - Mythic tier includes ONLY these enchantments (as enchanted_book or pre-enchanted item): Efficiency V, Sharpness V, Protection IV, Mending, Unbreaking III, Looting III, Fortune III. - Implementer must choose form (enchanted_book vs pre-enchanted item), provide exact item IDs (e.g., minecraft:enchanted_book with stored_enchantments entries), and state exact probabilities per enchantment (extremely rare, rarer than Legendary). - Other Rarities (COMMON→EPIC): Keep unchanged. - Format & Display Requirements: - Mythic lines use "❀ Mythic: <percentage>" with pink icon and purple percentage color per v114/v115 and colons instead of ellipses. - Implementation specifics: - Provide exact JSON contents for villager loot JSON path under data/universal-mob-foundry-4swppely/loot_tables (or equivalent), including enchanted_book stored_enchantments if used. v118 — Spawner Lore Update (Rarity Format Only): - On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format: - §f§lRARITY: - §7§l✹ Common: §8§lX.X% - §a§l✺ Uncommon: §2§lX.X% - §9§l✽ Rare: §1§lX.X% - §6§l✿ Legendary: §4§lX.X% - §d§l❀ Mythic: §5§lX.X% - Replace X.X% with actual drop rates from applicable loot table; keep other lore lines unchanged. v119 — Persistence & Sync Fix Request (context, observed bugs, constraints, deliverables): - Context: BlockEntity loses selected mob, unlocked purchases, hologram state after leave/rejoin; hologram can freeze; unlocks/bought items disappear after relog while ItemStack persists. - Requirements & Constraints: - Use Data Components for all persistent item/block data (mobId, rarity, unlocked list, hologram remaining/end timestamp) with ComponentType + Codec. Avoid raw NBT set/get usage. - BlockEntity must persist to world save using proper BlockEntity serialization hooks and call markDirty()/request client update on change. - Sync full state to clients on chunk load and when state changes (BlockEntity update packet or minimal custom S2C packet). GUI must read authoritative state from server. - On place: copy ItemStack components → BlockEntity components. On break/pickup: write BlockEntity components → ItemStack components (same schema). - Hologram: store numeric progress (remainingTime or endTimestamp). On load, recompute remainingTime from saved timestamp and server time; update hologram each server tick and push diff updates to clients. - Use safe defaults/getOrDefault to avoid NPEs. Server validates purchases/unlocks; client is read-only view unless server confirms. - Deliverables: 1) Short patch/diff or minimal code snippets (where to edit and which methods to add/change). 2) Clear list of files/classes to change: BlockEntity, BlockItem, ScreenHandler, client Screen, network handler (explicit list). 3) Short test plan: explicit steps and expected results (place, buy, leave/rejoin, reload chunk, break & re-place). 4) Explanation of why Components are used and what to avoid (no raw NBT). Prefer codecs for lists/strings for the unlocked list, store mob IDs as registry keys/strings. v122 & Boss & Villager Mythic-Tier Enhancements: - Villager Mythic Loot: high-value enchanted books (Sharpness V, Efficiency V, Protection IV, Mending I, Unbreaking III, Fortune III, Looting III) extremely rare; trades configured correctly for 1.21.5. - Boss Mythic Weapons: deliver one "thematic" overpowered Mythic weapon per boss (Ender Dragon sword, Warden axe, Wither bow, Elder Guardian trident) with allowed vanilla enchantments only; provide JSONs and item IDs and ensure drops added alongside normal boss loot. Automated Fabric 1.21.5 Multiplayer Tests Required (explicit list): - Break/place NBT persistence: place->break->pickup->place restores timers/unlocked/purchased/selected/display/lore/UUID. - Drop semantics: verify dropped block ItemStack lacks Items array; inventory contents dropped separately; DataComponents.BLOCK_ENTITY_DATA present in clone. - BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO-OUTPUT/AUTO-DROP atomicity & race tests. - GUI sync flows & client clearAndInit() on MobUnlockedS2CPacket/SyncDataS2CPacket; ScreenHandler constructor uses PacketByteBuf fallback; no world.getBlockEntity client calls. - Registry-aware ItemStack.parse/save tests to avoid "Missing id for entity" crashes. - Hologram cleanup tests (remove on break). - Scissor/clipping & hitbox correctness tests. Documentation & Migration Deliverables: - Packet formats for all C2S & S2C packets with field types & exact order. - PropertyDelegate indices & usage (primitives only). - BlockEntity NBT write/read order and full list of required keys + validation/clamping rules. - GUI pixel atlas & hitbox map for chosen GUI variant; chosen GUI variant documented and justified. - Reconciliation log listing which version rules were applied and why; explicitly note v2/v3/v14/v48/v61 choices and final v96/v100/v101/v103/v104/v105/v106/v107/v108/v109/v110/v111/v112/v113/v114 decisions. - Data Components migration explanation, migration code, DataComponentType definitions, registry registration and tests proving conversion from legacy NBT to components. - Patch/diff snippets and file/class change list for v119/v123 persistent fixes. Important Verbatim / Backup Requirements: - Keep historical recipe JSON(s) as backups per v101 including pre-v100 shaped recipe JSON and v100 1.21.5-compatible JSON (result.id). - v101 folder change: final recipe JSON placed in data/.../recipe/ (singular) and keep old recipes folder as backup. - v60 universal_mob_foundry_4swppely.json MUST be copied verbatim into datapack. - DO NOT include historical advancement file in final project (v105). Document v104 test that added it and v105 removal decision. FINAL ASSERTIONS (must be true in final deliverable): - fabric.mod.json id == "universal-mob-foundry-4swppely"; includes "main" and "client". - Advanced Spawner item registered as "universal-mob-foundry-4swppely:advanced_spawner". - data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json exists with v103 iron_block ring + emerald center pattern and result.id universal-mob-foundry-4swppely:advanced_spawner. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json copied verbatim (v60). - No advancement file for advanced_spawner in final tree. - Historical recipe backups included per v101 (pre-v100, v100). - Data Components migration implemented and tests pass. - Master loot mapping file produced (v54/v58) with duplicates removed and v110 rebalance applied. - Per-mob loot JSONs for PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109) implemented and rebalanced per v110. - Wither & Wither Skeleton head removals implemented and replacements documented (v110/v111). - Automated Fabric 1.21.5 multiplayer tests implemented, executed, reports included. - Hologram duplicate-on-reload bug fixed (old hologram removed on BlockEntity init) and tested. - Upgrade progression rebalanced to exponential storage/speed curve and documented. - All code uses registry-aware ItemStack.save/parse, BE.saveCustomOnly(HolderLookup.Provider), BE.loadAdditional(CompoundTag, HolderLookup.Provider) as required. - All network packets documented exactly; PropertyDelegate indices applied; client constructors accept PacketByteBuf fallback. - Reconciliation log included listing every version decision and justification. v123 — Fix BlockEntity Data Persistence Bug (Fabric 1.21.5) — Mandatory Fix Requirements: - Implement proper BlockEntity serialization/deserialization using Data Components (research correct 1.21.5 API), ensure all spawner data persists: selected mob, unlocked list, generation timer/status. - Implement toUpdatePacket()/toInitialChunkDataNbt() correctly to sync clients on chunk load and ensure hologram displays update and resume (store endTimestamp and recompute remainingTime). - Ensure ItemStack→BlockEntity and BlockEntity→ItemStack component copying on place/break; onPlaced() reads ItemStack Components; break writes BlockEntity components back to clone ItemStack via BE.saveCustomOnly(HolderLookup.Provider). - Add markDirty() and send BlockEntityUpdateS2CPacket + Sync/Refresh S2C when data changes; use HolderLookup.Provider. - Tests: verify persistence across quit/rejoin (place, buy/unlock, select, upgrade, collect, quit, rejoin → all state restored), hologram resumes correct remaining time. Fix 2 Spawner Issues — Fabric 1.21.5 (latest actionable bug fixes): - BUG 1: Duplicate Hologram on World Reload — Fix: on BlockEntity load, despawn any existing hologram at the block position before spawning a fresh one; track holograms for removal; test multiple quit/rejoin → only one hologram. - BUG 2: Upgrade Progression Rebalancing (exponential growth) — Implement exponential storage & speed progression (Levels 0–15) with small early gains and large late-game rewards; map storage (3→30) and speed (1.0x→3.0x) with specified bands; use Data Components only; include tests. Automated Tests & Reports (deliverables): - Place->break->pickup->place persistence tests; dropped clone lacks Items array; atomicity & race tests; GUI sync & packet ordering tests; registry-aware ItemStack parse/save tests; hologram cleanup on break and reload; scissor/clipping & hitbox tests. Documentation deliverables: - Packet formats (fields & order), PropertyDelegate mapping, BlockEntity component schema, BE write/read order, HolderLookup.Provider usage. - Loot table JSONs, master rarity mapping JSON (deduped from v54/v58) and v110 adjustments. - Reconciliation log mapping versions → decisions (call out v2,v3,v14,v48,v61 and final choices). - Patch/diff snippets and file/class change list for v119/v123 persistence fixes. - GUI atlas & hitbox pixel map for chosen GUI variant; note v111 panel color adjustment. Strict Final Checklist (validate before delivery): - All FINAL ASSERTIONS above must be satisfied (fabric.mod.json, Advanced Spawner id, recipe location & content, verbatim datapack JSON v60, absence of advancement file, backups included, Data Components migration/tests, master loot mapping & v110 rebalance, per-mob loot JSONs v107/v108/v109, Wither replacements, automated tests & reports, hologram duplicate fix tested, exponential upgrade progression, registry-aware serialization, network packet docs, reconciliation log). v127 — Additional Feature: INFORMATION GUI LOOT PANEL TOOLTIP: - Add hover tooltip for every item icon in the INFORMATION -> LOOT panel (including scrollable lists). - Tooltip must display: full Item Name (colors/bold/icon), full Item Lore exactly as stored (enchanted books show all enchantments and levels formatted as item lore, Mythic weapons show custom lore/enchantments), optionally the rarity in color. - Tooltip must read item NBT dynamically (so it always reflects actual name/lore/enchantments). - Tooltip matches Minecraft formatting (§ codes allowed), is informational-only (no modification), and works within the existing GUI. v127 — Additional Feature: Block Mining Behavior change: - Change block to be mineable only with iron pickaxe or higher to drop itself; wrong tool or bare hands drop nothing. - Breaking speed: - Bare hands ~3 seconds. - Iron pickaxe or better ~0.5–1.0 seconds. - Use standard Minecraft mining logic (mineable/pickaxe tag and needs_iron_tool tag). Keep same drop semantics and NBT/component rules otherwise. End-to-end Requirements (explicit actionable items for implementer): - Implement DataComponents-based BlockEntity persistence/migration per v61/v123; BE.saveCustomOnly(HolderLookup.Provider) & BE.loadAdditional(CompoundTag, HolderLookup.Provider); toUpdatePacket/toInitialChunkDataNbt fix; markDirty() & BlockEntityUpdateS2CPacket + Sync/Refresh S2C flows. - Implement server-authoritative packet handlers and S2C sync packets; document packet formats & field ordering. - Produce complete per-mob loot tables (v107/v108/v109) and master deduped mapping (v54/v58) and apply v110 rebalance, v111 Wither replacements, v117 villager rework, v122 boss Mythic weapons. - Implement home/shop/selection/claim/make-shulker/auto features server-atomically; enforce exactly-3-item purchase costs; selectMob starts timers server-side. - Implement GUI variant (choose and document) with scissor clipping, pixel atlas & hitbox map; apply v111 INFORMATION page panel color change; implement v127 LOOT hover tooltips reading item NBT. - Ensure tray/clone item NBT excludes Items array; drop inventory contents separately; clone includes DataComponents.BLOCK_ENTITY_DATA only. - Keep all verbatim/backups per v60 & v101; place final recipe per v103; do NOT include recipe advancement file (v105). - Provide automated Fabric multiplayer test suite & reports covering all listed test cases. - Provide full documentation: reconciliation log (versions decisions), packet specs, BE component schema & read/write order, migration details, GUI atlas/hitbox, and list of files/classes changed (patch/diff). - Fix hologram duplication and hologram-not-appearing regressions per v126: targeted duplicate detection/removal, spawn on place/load, recompute remaining time from endTimestamp, resume timers, markDirty() & sync. - Rebalance upgrades to exponential progression (storage & speed) and document numeric curve. - Ensure registry-aware ItemStack serialization everywhere and NBT hygiene rules enforced. - Final deliverable must pass all automated tests and meet the Strict Final Checklist. This summary includes the original spec plus every subsequent edit directive through v127 and enumerates required files, behaviors, version-specific rules, migration and testing deliverables, and final assertions the implementer must satisfy. Edit v128: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. # Fix Spawn Egg Icons in GUI - Fabric 1.21.5 ## BUG: Wrong Spawn Egg Icons Displayed **Affected Pages:** 1. **Home Page** - Dropdown menu to select mob 2. **Information Page** - Mob selection dropdown **Current Problem:** - When selecting a mob from dropdown, the icon shows ZOMBIE SPAWN EGG for almost all mobs - Example: Select "Ender Dragon" → displays zombie egg icon instead of dragon egg icon - Example: Select "Warden" → displays zombie egg icon instead of warden egg icon - The mob NAME displays correctly, but the ICON/egg is wrong **What should happen:** - Each mob should display its CORRECT spawn egg icon next to its name - Ender Dragon → Dragon spawn egg icon - Warden → Warden spawn egg icon - Zombie → Zombie spawn egg icon - Ravager → Ravager spawn egg icon - etc. --- ## YOUR FIX: **1. Diagnose the Icon Mapping Issue:** - Check how mob names are mapped to their spawn egg items - The system likely uses a default fallback (zombie egg) when it can't find the correct egg - Verify mob ID/registry name matching between mob selection and spawn egg item retrieval **2. Fix Icon Retrieval:** - For each mob in the dropdown, fetch the correct spawn egg item based on mob type - Use proper Minecraft registry names: `minecraft:ender_dragon` → `minecraft:dragon_spawn_egg` - Don't hardcode zombie egg as default - either show correct egg or no icon if unavailable - Handle special cases (Ender Dragon, Wither, etc.) that may have different egg registry names **3. Apply Fix to Both Pages:** - **Home Page**: Dropdown menu mob selection → correct egg icons - **Information Page**: Mob selection dropdown → correct egg icons - Ensure icon updates dynamically when mob selection changes **4. Test Every Mob:** - Verify each available mob (Zombie, Skeleton, Creeper, Ender Dragon, Warden, Ravager, etc.) shows correct egg - Make sure no mob falls back to zombie egg incorrectly --- ## Technical Notes: - Issue likely in: item stack creation for GUI icons, or mob type → spawn egg item mapping - May need to check: registry lookups, item ID handling, or GUI rendering code for spawn eggs - Ensure compatibility with Minecraft 1.21.5 spawn egg registry names
2
Oct 10, 2025, 05:30 PM
User request: Top-Level Objective: - Deliver full Fabric 1.21.5 mod source + assets implementing an Advanced Spawner with mod id/namespace "universal-mob-foundry-4swppely". - Advanced Spawner item id MUST be exactly "universal-mob-foundry-4swppely:advanced_spawner". - Provide full MOB LIST (exact entity IDs) and per-mob five-tier loot tables (COMMON/UNCOMMON/RARE/EPIC/LEGENDARY) and MYTHIC where specified; include PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) loot tables; apply v110 rebalance rules. - Provide master item→rarity mapping (deduplicated from v54/v58) and final mapping file. - Implement server-authoritative architecture and DataComponents-based BlockEntity persistence with migration for legacy NBT (v61/v63). - Provide automated Fabric 1.21.5 multiplayer tests, full documentation (packet formats, PropertyDelegate mapping, BlockEntity NBT keys & mandated write/read order, GUI atlas & hitbox pixel map), reconciliation log and test reports. - Implement and document explicit replacements for removed wither-skeleton-head drops (Wither Rare and Wither Skeleton Epic) per v110/v111 with justification. Primary Deliverables (explicit files/paths & behaviors): - Full Fabric 1.21.5 mod source & assets implementing architecture & rules. - Per-mob loot table files for full MOB LIST, rebalanced per v110; provide PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109). - Master item→rarity mapping (deduped from v54/v58). - Verbatim files & exact repo paths (preserve backups per v101): - src/main/resources/data/universal-mob-foundry-4swppely/recipes/advanced_spawner.json — implement v100/v101/v103 changes; keep backups per v101 and include historical pre-v100 JSONs. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json — COPY verbatim (v60 REQUIRED). - src/main/resources/data/universal-mob-foundry-4swppely/advancements/recipes/misc/advanced_spawner.json — historically recorded (v104 added; v105 removes it). FINAL: DO NOT include advancement file. - data/universal-mob-foundry-4swppely/workbenches.json (if custom workbench linking used). - pack.mcmeta for datapack inclusion. - Final recipe placement per v101: data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json (singular "recipe" folder recommended) containing v103 final pattern and result.id. Keep pre-v100 & v100 variants as backups per v101. - Automated Fabric 1.21.5 multiplayer tests covering break/place persistence, drop semantics, BUY/UPGRADE/CLAIM/MISC atomicity & race tests, GUI syncs, registry-aware ItemStack serialization, hologram cleanup, scissor/clipping & hitbox tests. - Full documentation & reconciliation log explaining applied version rules and why (explicitly note v96, v100/v101, v103, v104/v105, v106, v110, v111, v112, v113, v114). Final required explicit files/assertions: - fabric.mod.json id == "universal-mob-foundry-4swppely" and includes both "main" and "client". - Advanced Spawner item registered with exact Identifier "universal-mob-foundry-4swppely:advanced_spawner". - Final recipe JSON placed per v101 folder/format reflecting v103 pattern (iron_block ring with emerald center); result.id = universal-mob-foundry-4swppely:advanced_spawner. - universal_mob_foundry_4swppely.json copied verbatim into datapack (v60). - No advancement file for advanced_spawner present (v105 final). - Data Components migration implemented; legacy NBT migration tests pass. - Master loot mapping file (v54/v58) produced with duplicates removed and v107/v108/v109 loot included and v110 rebalance applied. - All documentation, tests, and reconciliation log delivered. - Implement and document explicit replacements for removed wither-skeleton-head drops per v110/v111. MANDATORY ARCHITECTURE & IMPLEMENTATION RULES (must follow exactly): - Server-authoritative only: C2S validated on server; server mutates BlockEntity + inventories atomically; server sends S2C syncs. - NEVER call world.getBlockEntity client-side; NEVER mutate BlockEntity client-side. - BlockEntity change flow: markDirty(); world.updateListeners(pos,state,state,3) or Block.NOTIFY_ALL; send BlockEntityUpdateS2CPacket + dedicated Sync/Refresh S2C packets for complex data. - ScreenHandler constructors must be client-safe: accept PacketByteBuf and fallback to SimpleInventory. Server opens via SimpleNamedScreenHandlerFactory writing BlockPos to PacketByteBuf. - PropertyDelegate for primitives ONLY; collections/unlocked set & selectedMob must be sent by dedicated S2C packets (SyncDataS2CPacket, UpgradeDataS2CPacket, MobUnlockedS2CPacket). - Use DataComponents.BLOCK_ENTITY_DATA and BE.saveCustomOnly(HolderLookup.Provider) for getCloneItemStack; BE.loadAdditional(CompoundTag, HolderLookup.Provider) for load. - Implement Data Components migration layer to read legacy NBT and write new component-based saves (v61/v63); include tests. - NEVER mutate BlockEntity client-side; collection sync via S2C only. - Null-check BlockEntity in ScreenHandler handlers; store BE reference server-side only via world.getBlockEntity(pos). - Always despawn hologram when block broken: HologramManager.removeHologramAt(pos) on onBroken and onStateReplaced. - Registry-aware ItemStack serialization everywhere: use stack.save(registryAccess, tag) and ItemStack.parse(registryAccess, tag).orElse(ItemStack.EMPTY). - DO NOT include BlockEntity Items array in dropped block item NBT. Drop inventory contents separately via Containers.dropContents(level,pos,inventory). Use DataComponents for clone/pickup metadata (exclude Items). - Validate ItemStacks before saving; clean duplicate keys; clamp sizes; replace invalid stacks with empty CompoundTag placeholder. - BE.saveCustomOnly / loadAdditional must use HolderLookup.Provider for registry-aware component serialization. Crafting Recipe — History, Rules & Final: - v60: universal_mob_foundry_4swppely.json must be copied verbatim into datapack. - v96: recipe historically made unlock-from-start (document). FINAL: craftable from start (no advancement). - v100: 1.21.5 compatibility: recipe result must use "result.id" instead of "result.item". - v101: keep old recipes folder as backup; create new singular data/.../recipe/ format; keep historical pre-v100 JSONs as backups. - v103 (definitive final): pattern = 3x3 iron_block ring with emerald center. Place in data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner; ensure datapack placement and backups. - v104: historically added advancement JSON for recipe; v105: completely removes advancement because craft known by default. FINAL: DO NOT include advancement file. - v106: reaffirm final: iron block ring with emerald center; craftable from start. - Backups: include historical recipe JSON(s) per v101 (pre-v100 and v100 variants). - v100/v101/v103/v104/v105/v106 reconciliation must be documented. Block Mining / Place / Break Behavior: - Hardness = 3.0f; tool must be suitable (tool.isSuitableFor + tier >= IRON); use tag fabric:needs_tool_level_2. Mining time ~ diamond ore; use diamond-ore sounds & particles. - If broken without suitable tool: destroyed without drop. On correct-tool break: block drops itself with BlockEntity metadata EXCEPT DO NOT include Items array in dropped block item NBT (v35/v36/v48). - Inventory contents dropped separately via Containers.dropContents(level,pos,inventory). - Dropped ItemStack must restore full state on place: timers, unlocked/purchased mobs, storage items (except Items array in dropped block NBT), toggles, level, UUID, display.Name/Lore, per-mob timers/metadata. - v24 mining crash fix: check state.isOf(this) before property access; wrap onStateReplaced/mining reads in try/catch. - v62 hologram removal on break. BlockEntity NBT / DataComponents — Keys & Mandated Write/Read Order: - Persisted keys and validation/clamping: unlockedMobs (List), purchasedMobs (List), selectedMob (String id), storageSlots & per-slot storageItems — Items array MUST NOT be included in dropped block item NBT. - Other persisted keys: timerProgress, upgradeLevel/level, shulkerMode/autoShulker/autoChest/autoDrop/autoOutput (boolean/byte), rarityPercentages (int array), speedMultiplier (float), slotsCount/storageSlots (int), uniqueUUID, display.Name, display.Lore, per-mob timers/metadata. - v14 mandated writeNbt/readNbt ORDER: write unlockedMobs, selectedMob, level (upgradeLevel), speedMultiplier, rarityBoosts, storageSlots; read must load in same order. - Use mutable collections (new ArrayList<>) not immutable List.of() (v13/v17). Validate NBT sizes/types and clamp limits. - v47 collectComponents pattern: safe primitives & lists for getCloneItemStack / DataComponents. Registry-Aware ItemStack Serialization & NBT Hygiene: - Always use registryAccess for ItemStack.save/parse to avoid "Missing id for entity" crashes (v29/v32). - DO NOT store Items array in clone/dropped ItemStack NBT (v34–v36/v48); use DataComponents.BLOCK_ENTITY_DATA via BE.saveCustomOnly(HolderLookup.Provider); BE.loadAdditional(CompoundTag, HolderLookup.Provider). - Implement migration layer (v61) to convert legacy NBT-based saves to Data Components; preserve backward compatibility while writing new component-based saves. Automatic Generation & Loot / Per-Mob Generation Rules: - SelectMobC2SPacket validated server-side starts continuous per-mob timers (persisted). On timer completion add generated item to storage, restart, stop when storage full. - Use inventory.setStack(slot,item); markDirty(); world.updateListeners(); send ScreenHandlerSlotUpdateS2CPacket for changed slots. - Loot tables per mob: five-tier mandatory. Base rarity distribution v2 authoritative: COMMON 60%, UNCOMMON 25%, RARE 10%, EPIC 4%, LEGENDARY 1%; later edits add Mythic & rebalance — document reconciliation choices and apply v110 rebalance. - Generation algorithm: choose rarity via spawner level & distribution; pick item from Map<MobType, Map<Rarity,List<ItemStack>>>; quantity rules: COMMON 1-10; UNCOMMON 1-15; RARE 1-5; EPIC/LEGENDARY/MYTHIC = 1 (non-stackables=1); scale with spawner level. - Rarity name/lore policy: v27 added rarity-colored name + lore; v97 removed rarity text from generated items (rarity shown only in GUI). Implementer must choose final behavior and document choice. - Per-mob generation times: v2 baseline authoritative unless overridden; boss timers long (ender_dragon example 900s) and reconcilable per v48/v110. Full Mob List (exact entity IDs required): - zombie, skeleton, spider, creeper, cow, pig, chicken, sheep, enderman, blaze, witch, ghast, iron_golem, villager, pillager, vindicator, evoker, wither_skeleton, guardian, elder_guardian, shulker, phantom, drowned, ravager, piglin_brute, hoglin, zoglin, warden, wither, ender_dragon, husk, stray, cave_spider, silverfish, bee, wolf, cat, ocelot, horse, donkey, mule, llama, trader_llama, panda, polar_bear, fox, dolphin, squid, glow_squid, cod, salmon, tropical_fish, pufferfish, axolotl, bat, parrot, rabbit, turtle, frog, tadpole, goat, allay, vex, strider. LOOT TABLES & v110/v111 Rebalance: - Implement PASSIVE (v107), HOSTILE (v108) and BOSS/SPECIAL (v109) per-mob loot tables mapping tokens to exact Minecraft item IDs. - v110: rebalance by HP/attack/difficulty/role; adjust probabilities & quality; adjust Epic→Mythic changes; explicitly remove Wither Skeleton head from Wither Skeleton Epic and from Wither Rare (Wither boss). Implement explicit replacements and document replacement items & justification. - v111: reaffirm replacement of Wither Rare loot & Wither Skeleton Epic loot to remove heads; implement replacements consistently and document. - v114/v115: display rarity percentage lines with icons: - "✹ Common: <percentage>" - "✺ Uncommon: <percentage>" - "✽ Rare: <percentage>" - "✿ Legendary: <percentage>" - "❀ Mythic: <percentage>" — Mythic icon pink and Mythic percentage purple; exact hex codes must be documented. - Reconciliation log must list exact adjustments applied to each mob (particularly Wither/Wither Skeleton) and the replacements (item IDs and justification). Home Tab (Shop & Selection Behavior): - Shop lists ALL mobs. Each entry: icon (spawn eggs replace mob heads per v37), mob name, exactly 3 required item icons + quantities (v37 enforces exactly 3 item types per mob). - BUY button toggles mob to UNLOCKED; BUY server-validated and atomically consumes exactly-3-item cost. - Hover tooltip shows required items & player's current amounts; BUY atomically consumes all 3 items server-side. - Right-side: scrollbar & mob selector dropdown: defaults "None", lists unlocked mobs only. Selection via SelectMobC2SPacket validated server-side sets selectedMob & starts timers; persists. - Storage slots: initial 3; expand via upgrades up to 27 mapping specified (document chosen progression if reconciled). - CLAIM button: server-side atomic transfer to player inventory with full/partial checks and locking. - MAKE SHULKER / AUTO-SHULKER / AUTO-CHEST / AUTO-DROP / AUTO-OUTPUT behaviors defined with unlock levels & atomic transfer semantics. - v48: RARITY FILTER BUTTON replaces AUTO-CHEST and cycles Common→Mythic; generator skips rolled rarities below minRarityFilter. - GUI hitboxes must align with visuals; implement scissor clipping & pixel atlas; document chosen GUI variant. Upgrades Tab & Mechanics: - Levels 0–15 (start L0 per v35). UPGRADE server-side atomic: consume items, increment level. - Exact upgrade costs authoritative mapping: v3 authoritative unless reconciliation chooses v47/v48 alternatives — document choice. - Speed multipliers mapping authoritative (v3 unless v35 redesign): L1=1.1x … L15=3.0x (document chosen mapping). - Rarity percentage shifts authoritative mapping from v3 unless overridden; Mythic introduced later — reconcile & document. - Storage progression authoritative mapping included (L1:3; L2:6; L3:9; L4:12; L5:15; L7:18; L9:21; L11:24; L13:27). - Unlocks: MAKE SHULKER L7; AUTO OUTPUT/AUTO DROP L10. - Upgrades UI server-authoritative; sync via UpgradeDataS2CPacket. GUI Variants & Final Choice Rule: - Allowed final GUI variants: choose one of v4, v5, v6, v9, v10, v11, v13, v14 (v14 preferred) or a v17-like overhaul. Implementer picks one and documents chosen variant and any deviations. - Enforce scissor clipping & z-order & hitbox parity via GuiGraphics.enableScissor() for scroll areas (v31). - Provide pixel atlas & hitbox pixel map for chosen GUI. - v110/v111 GUI edits: - v110: INFORMATION page must visually match UPGRADES page (color palette, borders, layout). - v111: change ONLY the panel color on INFORMATION page to exactly match UPGRADES page panels (background & border), leave text/layout/shadows unchanged. Color Palette (authoritative v17/v18 & rarity color rules): - BG(15,15,18), Panel(22,25,30), Element(28,32,38), Border(42,46,52), White(245,248,252), Gray(140,145,155), Green(80,170,95), Unlocked(45,130,80), Purple(140,110,200), Gold(210,150,50). - Rarity colors enumerated; v27 adds Mythic styling. - v114: Mythic icon color pink and Mythic percentage color purple — exact hex codes must be documented in final deliverable. - Final lore color format required by v117 (legacy § codes) is provided and must be implemented in output tooltips/GUI. Network / Client-Server Packets & Protocol: - ClientModInitializer required; fabric.mod.json must include "main" and "client". - Mandatory C2S packets: UpgradeRequestC2SPacket, BuyMobC2SPacket, SelectMobC2SPacket, ClaimC2SPacket, MakeShulkerC2SPacket, ToggleAutoC2SPacket. - S2C packets: UnlockedMobsSyncS2CPacket, MobUnlockedS2CPacket, UpgradeDataS2CPacket, SyncDataS2CPacket, RefreshGuiS2CPacket. - PropertyDelegate indices (v18): 0: level; 1–5: rarity percentages; 6: speedMultiplier*100 (int); 7: storage slots count; 8–27: unlocked bitfield (or send as packet). - After unlock: send MobUnlockedS2CPacket and client must refresh GUI via clearAndInit()/updateUnlockedMobs() on client thread. - Packet formats with field types & order must be documented exactly. Stability & Implementation Directives: - Server-side atomic inventory checks/removal for purchases/upgrades before committing and syncing. Validate slot indices and container sync parity; use 0-based indexing. - After server-side NBT changes call markDirty(); world.updateListeners(..., Block.NOTIFY_ALL); send BlockEntityUpdateS2CPacket + Sync/Refresh S2C packets. - SFX/particles per state; high-rarity generation plays special sound & particles. - GuiGraphics.enableScissor() for scroll areas; strict render bounds and z-order. - Provide automated Fabric 1.21.5 multiplayer tests (explicit list below). Make Shulker / Auto Behaviors: - MAKE SHULKER: unlock L7; togglable; creates filled shulker_box with content NBT and atomic transfer to player. - AUTO OUTPUT: unlock L10; outputs items to block at (x+1) server-side. - AUTO-CHEST: simulate chest placement/fill behavior (v33). - AUTO-DROP: when ON and all slots full, drops ALL contents at x+1 as ItemEntities and clears inventory (v48). - v48: RARITY FILTER replaces AUTO-CHEST; cycles Common→Mythic and generator skips rolled rarities below minRarityFilter. Lore / Dropped Item Display / Dynamic Tooltip: - display.Name: Format per v112/v113/v114. en_us translation required. - display.Lore persists across drop/place except Items array removal. - appendTooltip reads NBT for live values (Level, Selected, Unlocked, Storage, Speed, rarity percents), color-coded per brightness rule in v112. - v27 added rarity lore for generated items; v97 removed rarity text from generated items; implementer chooses final behavior and documents choice. - v112: ITEM NAME = gradient composition "Advanced Spawner [Lvl X]" using Component.literal fragments with specified hex colors & bold flags; set via DataComponents.CUSTOM_NAME in collectImplicitComponents(). LORE cleaned and stored via DataComponents.LORE; remove duplicate title lines & technical component text. - v113: LORE rarity icons changed to glyphs: "✹ Common...", "✺ Uncommon...", "✽ Rare...", "✿ Legendary...", "❀ Mythic...". FINAL legacy-style item name string must be "&A&lAd&2&lva&l3lnc&9&led &8&lSpa&7&lwn&F&ler &F&l[Lvl {level}]" (implement via DataComponents.CUSTOM_NAME with conversion/compatibility). - v114/v115: Rarity percentage display lines must be shown with icons and percentages as listed; Mythic icon pink and Mythic percentage text purple; use colons instead of ellipses. NBT Serialization Critical Pattern & Migration: - Use registryAccess for ItemStack save/parse everywhere. - DO NOT store Items array in clone ItemStack NBT; use DataComponents.BLOCK_ENTITY_DATA with clean tag via BE.saveCustomOnly(HolderLookup.Provider). BE.loadAdditional(CompoundTag, HolderLookup.Provider). - v61: implement migration layer converting legacy NBT to Data Components; keep legacy readNbt for conversion, then write new saves exclusively with components via addComponents()/readComponents(); include tests and migration explanation. Implementation Checklist (prioritized): 1. DataComponents pattern & migration layer (v48 & v61); tests place->break->place persistence. 2. Fix drop semantics: remove Items array from clone/dropped ItemStack NBT; drop inventory contents separately; attach minimal DataComponents payload via BLOCK_ENTITY_DATA. 3. Use registry-aware ItemStack.save/parse across codebase. 4. Server-authoritative atomic ops for BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO actions; locking & race tests. 5. Full five-tier loot tables for full mob list; produce master mapping (v54/v58) and rebalances per v110. 6. Home tab: shop UI (spawn egg icons per v37), BUY C2S -> server validate -> unlock -> MobUnlockedS2CPacket -> client refresh; SelectMobC2SPacket starts timers. 7. Storage expansion mapping, CLAIM, MAKE SHULKER/AUTO-CHEST (rarity filter)/AUTO-DROP server-atomic. 8. Upgrades tab L0–L15 with costs & multipliers; document chosen authoritative mapping if conflicts. 9. ScreenHandler & Screen client-safe constructors (PacketByteBuf fallback); never call BE on client. 10. SyncDataS2CPacket / RefreshGuiS2CPacket flows on GUI open & after changes; client updates handler & calls screen.clearAndInit() on client thread. 11. SFX/particles, spawn-egg shop icons, translations. 12. Automated test suite and reports. 13. fabric.mod.json id equals "universal-mob-foundry-4swppely" and includes both "main" and "client"; register Advanced Spawner item with exact Identifier. Conflicts & Reconciliation Rules: - Authoritative precedence: (1) v2 per-mob times, (2) v3 upgrades/costs/multipliers/rarity-breakpoints/storage mapping, (3) v14/v16/v17 NBT & network mandates. - Later edits (v18–v48+) must not violate authoritative mechanics. Where conflicts exist, preserve authoritative constraints; apply NBT/stability fixes as highest priority; document reconciliation decisions in reconciliation log. Chronological Highlights (one-line per notable version — include reconciliation-note usage): - v1: Original block, crafting, HOME shop ALL mobs, 3 storage slots, basic CLAIM & MAKE SHULKER/AUTO placeholders. - v2: Added per-mob timers, continuous generation, five-tier loot tables, base rarity 60/25/10/4/1 (authoritative for times & base rarities). - v3: Added UPGRADES 1–15, speed multipliers, rarity shift breakpoints, storage progression to 27; MAKE SHULKER L7 & AUTO OUTPUT L10 (authoritative for upgrades/storage/rarity breakpoints). - v4–v6: GUI sizes/bug fixes; server-side validation & atomic ops added. - v7–v9: Fabric 1.21.5 target reaffirmed, entrypoint fixes. - v10–v14: GUI overhauls; v14 enforces writeNbt/readNbt order and tooltip rules. - v16–v18: Recipe shaped JSON fixes; PropertyDelegate and packet protocol defined; client-safe ScreenHandler constructors mandated. - v19–v25: Crash fixes, mining enforcement, diamond-ore sound; slot update packets and hologram fixes. - v26–v31: UI scissor enforcement; NBT serialization cleaning. - v27: Rarity overhaul adds Mythic & colored lore (later mitigated). - v29/v32: Fix "Missing id for entity" via registry-aware ItemStack serialization. - v33: AUTO-SHULKER→AUTO-CHEST; AUTO-DROP clarified. - v34–v36: CRITICAL: DO NOT save Items array in dropped block item; drop via Containers.dropContents; Upgrades start at Level 0. - v37: Shop enforces 3-item costs; spawn eggs used as icons. - v38–v42: Loot table composition refined. - v45: UI polish & alignment fixes. - v47: UPGRADES reconstruction; collectComponents pattern for clone. - v48: CRITICAL DataComponents pattern established; DO NOT put Items into ItemStack NBT; hologram strictness; rarity filter introduced. - v53: Shop price updates. - v54 & v58: FIX RARITY DUPLICATES — produce master mapping and remove cross-tier duplicates (MANDATORY). - v57: Advanced Spawner recipe changed historically to CCC/INI/CCC (predecessor pattern; documented backup required). - v60: CRITICAL: include universal_mob_foundry_4swppely.json verbatim (datapack copy). - v61: Convert legacy NBT saving to Data Components; add migration layer. - v62–v63: Hologram removal & DataComponents persistence extensions; tests required. - v65–v73: GUI resize, procedural rules, per-level rarity distribution (Mythic in v73), GUI percent decimals. - v74–v82: Recipe rebuild enforcement; delete old recipes; add exact JSON at data/.../recipes/; v80/v82 removed unsupported fields; repackage & test. - v76: INFORMATION TAB added (live 3D model + loot/costs). - v83–v95: GUI/render/hitbox fixes, recipe troubleshooting, enforce registration & modid consistency, resource packaging checks. - v96: HISTORICAL EDIT: recipe unlocked from start (document). Final behavior: craftable from start. - v97–v99: Info page final fixes. - v100: FIX RECIPE PROBLEM — change "result.item" → "result.id" for 1.21.5 compatibility. - v101: Keep old recipes folder backup; create data/.../recipe/ (singular); preserve historical pre-v100 JSON. - v103: Definitive recipe change to iron_block ring with emerald center (supersedes prior patterns). - v104: Added advancement JSON historically and verified craft behavior (document; later removed). - v105: Remove advancement file (FINAL: no advancement included). - v106: Reinforce final: recipe craftable from start; treat as first-time mod. - v107: PASSIVE LOOT TABLES added/defined. - v108: HOSTILE LOOT TABLES added/defined. - v109: BOSS & SPECIAL LOOT TABLES added/defined. - v110: Rebalance all mob loot tables by HP/attack/difficulty/role; adjust probabilities/quality; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document. - v111: GUI: change only INFORMATION page panel color to match UPGRADES page panels; implement Wither head removal replacements. - v112: Advanced Spawner item NAME & LORE FIX: gradient name and lore cleaning via DataComponents in collectImplicitComponents(); remove duplicate title lines. - v113: LORE rarity icons to "✹/✺/✽/✿/❀" prefixes; FINAL legacy-style item name string set to exact ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must include icons and percentages as listed and ensure Mythic icon is pink and Mythic percentage text is purple (document exact colors). - v115: Replace "..." with ":" in all rarity lore lines and enforce Mythic icon pink + Mythic percentage purple. - v117: Rework Villager loot table: remove existing Legendary villager drops; add minecraft:emerald_block as Legendary (document probability or guarantee) + one additional villager-representative Legendary item (implementer chooses ID & prob); Mythic tier only specific enchantments; provide numeric probabilities; JSON path & content required. - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates; keep other lore unchanged. - v119: Persistence & Sync Fix Request — Use Data Components for all persistent item/block data; copy components on place/pickup; hologram endTimestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder to plan, simplify on loops/errors, and finish tasks. - v123: Fix BlockEntity Data Persistence Bug — FULL directive to research & implement Data Components (NOT NBT) for BlockEntity persistence in Fabric 1.21.5; implement write/read equivalents, toUpdatePacket/toInitialChunkDataNbt, ensure hologram resumes and not frozen, ensure ItemStack↔BlockEntity component transfer on place/break, add markDirty() calls after each modification, do NOT use NBT-based solutions or outdated 1.19/1.20 methods; test persistence across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Reinforce planning advice and add CRITICAL BUG: Hologram Not Appearing Anymore — provide corrective steps to ensure hologram spawns on place & on join, resumes timers, prevents duplicates without removing hologram logic. Edits & Latest Directives Summary (actionable changes — one-line each): - v96: Document historical recipe unlocked-from-start; FINAL: craftable from start (no advancement). - v100: Change recipe JSON to use "result.id" for 1.21.5 compatibility. - v101: Move new recipe to data/.../recipe/ (singular) and keep old recipes folder as backup; include pre-v100 and v100 backups. - v103: Definitive recipe: iron_block ring with emerald center; place at data/.../recipe/advanced_spawner.json with result.id = universal-mob-foundry-4swppely:advanced_spawner. - v104: Historically added advancement JSON for recipe (document). - v105: Remove advancement file; FINAL: do not include. - v106: Reaffirm craftable from start. - v107: Add PASSIVE loot tables. - v108: Add HOSTILE loot tables. - v109: Add BOSS/SPECIAL loot tables. - v110: Rebalance all loot tables by HP/difficulty/role; remove Wither Skeleton head from Wither Skeleton Epic and Wither Rare (Wither boss); implement replacements & document reasons. - v111: Change ONLY INFORMATION page panel color to match UPGRADES page panels; apply Wither head replacements. - v112: Implement Advanced Spawner item name gradient & clean lore via DataComponents in collectImplicitComponents(); avoid duplicate titles. - v113: Change lore rarity icons to "✹/✺/✽/✿/❀" and set final legacy-style name string to the given ampersand-coded pattern via DataComponents.CUSTOM_NAME compatibility. - v114: Rarity percentage display lines must be prefixed with icons and for Mythic use pink icon and purple percentage color. - v115: Plan before coding; on loops/errors simplify & retry; always finish the task. Replace "..." with ":" in all rarity lore; ensure Mythic icon pink and Mythic percentage purple. - v117: Villager loot rework (remove Legendary villager drops; add emerald_block + one villager item as Legendary with numeric probabilities; Mythic tier limited to specified enchantments; provide exact JSON, item IDs, probabilities). - v118: Spawner Lore Update — On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format with actual rates. - v119: Persistence & Sync Fix Request — Data Components for all persistent data; copy components on place/pickup; hologram timestamp handling; provide patch/diff, file/class list, test plan; avoid raw NBT. - v122: Procedural reminder — plan, simplify on loops/errors, finish tasks. - v123: Fix BlockEntity Data Persistence Bug — research & implement Fabric 1.21.5 Data Components-based persistence for BlockEntity (NOT NBT), correct toUpdatePacket/toInitialChunkDataNbt, ensure ItemStack↔BlockEntity component transfers, markDirty() on changes, hologram resume, tests across quit/rejoin. - v125: Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. - v126: Hologram Bug: hologram not appearing after prior fix; mandated corrective behavior: spawn on place & load, resume timers, prevent duplicates by targeted duplicate detection/removal (not aggressive deletion), and include tests verifying single hologram, correct timer continuation, updates on selection changes. v117 — Villager Loot Table Rework (detailed requirements): - Legendary Tier: - Remove all existing Legendary drops for villager. - Add minecraft:emerald_block as a Legendary drop (deliverable MUST document whether guaranteed OR "very rare"; if "very rare" provide exact probability). - Add one additional villager-representative Legendary item (implementer chooses exact item ID and documents justification & probability). - Provide numeric probabilities and balancing rationale (e.g., Legendary combined chance 0.5% with emerald_block 0.2% + villager-item 0.3% or alternate). - Mythic Tier: - Mythic tier includes ONLY these enchantments (as enchanted_book or pre-enchanted item): Efficiency V, Sharpness V, Protection IV, Mending, Unbreaking III, Looting III, Fortune III. - Implementer must choose form (enchanted_book vs pre-enchanted item), provide exact item IDs (e.g., minecraft:enchanted_book with stored_enchantments entries), and state exact probabilities per enchantment (extremely rare, rarer than Legendary). - Other Rarities (COMMON→EPIC): Keep unchanged. - Format & Display Requirements: - Mythic lines use "❀ Mythic: <percentage>" with pink icon and purple percentage color per v114/v115 and colons instead of ellipses. - Implementation specifics: - Provide exact JSON contents for villager loot JSON path under data/universal-mob-foundry-4swppely/loot_tables (or equivalent), including enchanted_book stored_enchantments if used. v118 — Spawner Lore Update (Rarity Format Only): - On block break & retrieval, update only the rarity lines in retrieved spawner lore to exact §-coded format: - §f§lRARITY: - §7§l✹ Common: §8§lX.X% - §a§l✺ Uncommon: §2§lX.X% - §9§l✽ Rare: §1§lX.X% - §6§l✿ Legendary: §4§lX.X% - §d§l❀ Mythic: §5§lX.X% - Replace X.X% with actual drop rates from applicable loot table; keep other lore lines unchanged. v119 — Persistence & Sync Fix Request (context, observed bugs, constraints, deliverables): - Context: BlockEntity loses selected mob, unlocked purchases, hologram state after leave/rejoin; hologram can freeze; unlocks/bought items disappear after relog while ItemStack persists. - Requirements & Constraints: - Use Data Components for all persistent item/block data (mobId, rarity, unlocked list, hologram remaining/end timestamp) with ComponentType + Codec. Avoid raw NBT set/get usage. - BlockEntity must persist to world save using proper BlockEntity serialization hooks and call markDirty()/request client update on change. - Sync full state to clients on chunk load and when state changes (BlockEntity update packet or minimal custom S2C packet). GUI must read authoritative state from server. - On place: copy ItemStack components → BlockEntity components. On break/pickup: write BlockEntity components → ItemStack components (same schema). - Hologram: store numeric progress (remainingTime or endTimestamp). On load, recompute remainingTime from saved timestamp and server time; update hologram each server tick and push diff updates to clients. - Use safe defaults/getOrDefault to avoid NPEs. Server validates purchases/unlocks; client is read-only view unless server confirms. - Deliverables: 1) Short patch/diff or minimal code snippets (where to edit and which methods to add/change). 2) Clear list of files/classes to change: BlockEntity, BlockItem, ScreenHandler, client Screen, network handler (explicit list). 3) Short test plan: explicit steps and expected results (place, buy, leave/rejoin, reload chunk, break & re-place). 4) Explanation of why Components are used and what to avoid (no raw NBT). Prefer codecs for lists/strings for the unlocked list, store mob IDs as registry keys/strings. v122 & Boss & Villager Mythic-Tier Enhancements: - Villager Mythic Loot: high-value enchanted books (Sharpness V, Efficiency V, Protection IV, Mending I, Unbreaking III, Fortune III, Looting III) extremely rare; trades configured correctly for 1.21.5. - Boss Mythic Weapons: deliver one "thematic" overpowered Mythic weapon per boss (Ender Dragon sword, Warden axe, Wither bow, Elder Guardian trident) with allowed vanilla enchantments only; provide JSONs and item IDs and ensure drops added alongside normal boss loot. Automated Fabric 1.21.5 Multiplayer Tests Required (explicit list): - Break/place NBT persistence: place->break->pickup->place restores timers/unlocked/purchased/selected/display/lore/UUID. - Drop semantics: verify dropped block ItemStack lacks Items array; inventory contents dropped separately; DataComponents.BLOCK_ENTITY_DATA present in clone. - BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO-OUTPUT/AUTO-DROP atomicity & race tests. - GUI sync flows & client clearAndInit() on MobUnlockedS2CPacket/SyncDataS2CPacket; ScreenHandler constructor uses PacketByteBuf fallback; no world.getBlockEntity client calls. - Registry-aware ItemStack.parse/save tests to avoid "Missing id for entity" crashes. - Hologram cleanup tests (remove on break). - Scissor/clipping & hitbox correctness tests. Documentation & Migration Deliverables: - Packet formats for all C2S & S2C packets with field types & exact order. - PropertyDelegate indices & usage (primitives only). - BlockEntity NBT write/read order and full list of required keys + validation/clamping rules. - GUI pixel atlas & hitbox map for chosen GUI variant; chosen GUI variant documented and justified. - Reconciliation log listing which version rules were applied and why; explicitly note v2/v3/v14/v48/v61 choices and final v96/v100/v101/v103/v104/v105/v106/v107/v108/v109/v110/v111/v112/v113/v114 decisions. - Data Components migration explanation, migration code, DataComponentType definitions, registry registration and tests proving conversion from legacy NBT to components. - Patch/diff snippets and file/class change list for v119/v123 persistent fixes. Important Verbatim / Backup Requirements: - Keep historical recipe JSON(s) as backups per v101 including pre-v100 shaped recipe JSON and v100 1.21.5-compatible JSON (result.id). - v101 folder change: final recipe JSON placed in data/.../recipe/ (singular) and keep old recipes folder as backup. - v60 universal_mob_foundry_4swppely.json MUST be copied verbatim into datapack. - DO NOT include historical advancement file in final project (v105). Document v104 test that added it and v105 removal decision. FINAL ASSERTIONS (must be true in final deliverable): - fabric.mod.json id == "universal-mob-foundry-4swppely"; includes "main" and "client". - Advanced Spawner item registered as "universal-mob-foundry-4swppely:advanced_spawner". - data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json exists with v103 iron_block ring + emerald center pattern and result.id universal-mob-foundry-4swppely:advanced_spawner. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json copied verbatim (v60). - No advancement file for advanced_spawner in final tree. - Historical recipe backups included per v101 (pre-v100, v100). - Data Components migration implemented and tests pass. - Master loot mapping file produced (v54/v58) with duplicates removed and v110 rebalance applied. - Per-mob loot JSONs for PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109) implemented and rebalanced per v110. - Wither & Wither Skeleton head removals implemented and replacements documented (v110/v111). - Automated Fabric 1.21.5 multiplayer tests implemented, executed, reports included. - Hologram duplicate-on-reload bug fixed (old hologram removed on BlockEntity init) and tested. - Upgrade progression rebalanced to exponential storage/speed curve and documented. - All code uses registry-aware ItemStack.save/parse, BE.saveCustomOnly(HolderLookup.Provider), BE.loadAdditional(CompoundTag, HolderLookup.Provider) as required. - All network packets documented exactly; PropertyDelegate indices applied; client constructors accept PacketByteBuf fallback. - Reconciliation log included listing every version decision and justification. v123 — Fix BlockEntity Data Persistence Bug (Fabric 1.21.5) — Mandatory Fix Requirements: - Problem: BlockEntity loses all data on world reload though ItemStack preserves data. Works in-session; resets to defaults after quit/rejoin when block placed. - Mandatory fix: Research & implement Data Components-based BlockEntity persistence (NOT NBT) for Fabric 1.21.5. - Requirements: 1) Implement proper BlockEntity serialization/deserialization using Components (research correct 1.21.5 API methods), ensure all spawner data persists: selected mob, unlocked mobs list, generation timer, generation status. 2) Implement toUpdatePacket()/toInitialChunkDataNbt() correctly to sync clients on chunk load and ensure hologram displays update and resume (store endTimestamp and recompute remainingTime). 3) Ensure ItemStack→BlockEntity and BlockEntity→ItemStack component copying on place/break; onPlaced() reads ItemStack Components; break writes BlockEntity components back to clone ItemStack via BE.saveCustomOnly(HolderLookup.Provider). 4) Add markDirty() after every data modification and send BlockEntityUpdateS2CPacket + Sync/Refresh S2C as needed. 5) Use HolderLookup.Provider for registry-aware component serialization; DO NOT use NBT-only solutions or outdated methods. - Tests: Verify persistence across quit/rejoin (place, buy/unlock, select, upgrade, collect, quit, rejoin → all state restored), hologram resumes correct remaining time, no frozen hologram values. - Deliverable: Implement changes + tests + short patch/diff showing where to edit methods, list of classes changed (BlockEntity, BlockItem, ScreenHandler, Screen, network handler), and a short test plan. Edit v125 — Procedural Reminder: - Always plan before coding. If you encounter a loop or error, simplify and retry logically instead of stopping. Always finish the task. Fix 2 Spawner Issues — Fabric 1.21.5 (latest actionable bug fixes): - BUG 1: Duplicate Hologram on World Reload - Symptom: On rejoin a new hologram spawns correctly but the old hologram remains → two holograms stacked. - Fix required: 1) On BlockEntity load/initialization, forcefully despawn ANY existing hologram entities at that block position before spawning new one. 2) Only after cleanup spawn fresh hologram with current data. 3) Ensure hologram entities are properly tracked for removal. 4) Test: multiple quit/rejoin → only ONE hologram exists each time. - BUG 2: Upgrade Progression Rebalancing (require exponential progression) - Current problem: Level 1 gives too many storage slots; speed multiplier growth is linear. - Required exponential progression: - STORAGE SLOTS (3 → 30 slots, levels 0-15): - Level 0: 3 slots - Levels 1-5: Slow growth (reach ~8-10 slots) - Levels 6-10: Moderate growth (reach ~15 slots) - Levels 11-15: Explosive growth, 15 → 30 slots - SPEED MULTIPLIER (1.0x → 3.0x, levels 0-15): - Level 0: 1.0x - Levels 1-5: Very slow increase (near 1.0x-1.1x) - Levels 6-10: Gradual increase to ~1.5x - Levels 11-15: Massive jump 1.5x → 3.0x - Goal: early levels feel grindy; large late-game rewards. - Both fixes MUST use Data Components (NOT NBT) and Fabric 1.21.5 methods only; include tests. Required Automated Tests & Reports (include these as deliverables): - Place->break->pickup->place persistence tests (timers/unlocks/selected/display/lore/UUID). - Dropped clone lacks Items array; inventory contents dropped separately; DataComponents.BLOCK_ENTITY_DATA present. - Atomicity & race tests for BUY/UPGRADE/CLAIM/MAKE SHULKER/AUTO behaviors. - GUI sync & packet ordering tests; ensure client-safe ScreenHandler constructors. - Registry-aware ItemStack save/parse tests. - Hologram cleanup on break and after reload tests. - Scissor/clipping & hitbox tests. Deliver final documentation including: - Packet formats (fields & order), PropertyDelegate mapping, BlockEntity component schema, BE write/read order, holder/registry usage (HolderLookup.Provider). - Loot table JSONs, master rarity mapping JSON (deduplicated from v54/v58) and v110 adjustments. - Reconciliation log mapping versions → decisions (explicitly call out v2, v3, v14, v48, v61 and final choices for v96/v100/v101/v103/v104/v105/v106/v107/v108/v109/v110/v111/v112/v113/v114). - Patch/diff snippets and file/class change list for v119/v123 persistent fixes. - GUI atlas & hitbox pixel map for chosen GUI variant and note v111 panel color adjustment. Strict Final Checklist to validate before delivery: - fabric.mod.json id == "universal-mob-foundry-4swppely"; includes "main" and "client". - Advanced Spawner registered as "universal-mob-foundry-4swppely:advanced_spawner". - data/universal-mob-foundry-4swppely/recipe/advanced_spawner.json exists with v103 iron_block ring + emerald center pattern and result.id universal-mob-foundry-4swppely:advanced_spawner. - src/main/resources/data/universal-mob-foundry-4swppely/recipes/universal_mob_foundry_4swppely.json copied verbatim (v60). - No advancement file for advanced_spawner in final tree. - Historical recipe backups included per v101 (pre-v100, v100). - Data Components migration implemented and tests pass. - Master loot mapping file produced (v54/v58) with duplicates removed and v110 rebalance applied. - Per-mob loot JSONs for PASSIVE (v107), HOSTILE (v108), BOSS/SPECIAL (v109) implemented and rebalanced per v110. - Wither & Wither Skeleton head removals implemented and replacements documented (v110/v111). - Automated Fabric 1.21.5 multiplayer tests implemented, executed, reports included. - Hologram duplicate-on-reload bug fixed (old hologram removed on BlockEntity init) and tested. - Upgrade progression rebalanced to exponential storage/speed curve and documented. - All code uses registry-aware ItemStack.save/parse, BE.saveCustomOnly(HolderLookup.Provider), BE.loadAdditional(CompoundTag, HolderLookup.Provider) as required. - All network packets documented exactly; PropertyDelegate indices applied; client constructors accept PacketByteBuf fallback. - Reconciliation log included listing every version decision and justification. End of summarized prompt and edit history (includes every requested change and edit up to v126). CRITICAL Hologram Display Bug — Fix Notes (v126): - Observed regression: hologram removed entirely after prior fix. - Required behavior: - Spawn hologram immediately on block place. - Spawn hologram on BlockEntity load (on join) with correct persisted data (selected mob, timer progress, status). - Resume timers from saved value; recompute remainingTime from saved endTimestamp on load. - Prevent duplication: before spawning on load, detect existing hologram entities at position; remove duplicates (targeted removal) then spawn fresh one. Do NOT globally suppress spawning. - Ensure hologram tracking/IDs so removal on block break or replacement is reliable. - Tests: place→hologram appears; select & wait→quit & rejoin→hologram shows continued timer; multiple rejoin cycles produce single hologram each time. - Implementation constraints: use Data Components (NOT raw NBT), call markDirty() & send BlockEntityUpdateS2CPacket + Sync/Refresh S2C when hologram state changes, recompute timers server-side, push minimal diffs to clients. Final procedural reminders: - Always plan before coding; simplify loops/errors and retry; finish tasks; document reconciliation and decisions for each conflicting version. Edit v127: Goal: In Minecraft 1.21.5, enhance the existing “Information” GUI for mobs. Specifically, in the “LOOT” panel, when hovering the mouse over any item icon in the loot list, a small tooltip popup should appear displaying the full details of the item. Tooltip Requirements: 1. Item Name: Display the full name with all colors, bold formatting, and icon if applicable. 2. Item Lore: Show the complete lore of the item exactly as it exists, including: - For enchanted books: all enchantments with their levels, formatted as in the item lore (do not use default enchant table display). - For the 4 Mythic weapons (Death, War, Famine, Conquest): display all custom lore and overpowered enchantments exactly as they appear on the weapon. 3. Rarity: Optionally display the rarity of the item (Common, Uncommon, Rare, Epic, Mythic) in color-coded text. 4. The tooltip must be fully readable and match Minecraft formatting conventions (§ color codes, bold, italic, etc.). 5. Tooltip is strictly informational and does not modify the item or its stats. Functionality Requirements: - The hover tooltip must work for **all items in the LOOT panel**, from Common to Mythic. - Tooltip must dynamically read the item’s NBT data to ensure the displayed name, lore, and enchantments are always accurate. - Works in the existing GUI only; no new GUI panels need to be created. - For scrollable loot lists, hovering over any item icon anywhere in the list triggers the tooltip. Outcome: - Players can see a small popup with the item’s name, lore, and enchantments for every loot item in the Information GUI. - Ensures that Mythic items, enchanted books, and custom boss weapons display all their special enchantments correctly in the hover tooltip. - Provides a clear, interactive way to inspect all loot items without opening the inventory or modifying the GUI structure. ────────────────────────────── Additional Feature – Block Mining Behavior: Modify the custom block so that it behaves similarly to stone in terms of mining requirements and breaking speed. Block Requirements: 1. The block must be **mineable only with an iron pickaxe or higher** to drop itself. - If broken with bare hands or an inappropriate tool, it drops nothing. 2. Breaking speed configuration: - With bare hands → approximately **3 seconds** to break. - With an **iron pickaxe or better** → approximately **0.5 to 1 second** to break. 3. Use standard Minecraft mining logic (tool effectiveness, harvest level, hardness). 4. Keep the same drop system, only adjust breaking time and mining level. 5. Ensure that the block’s hardness, mining level, and tool tags reflect this configuration (e.g., "minecraft:mineable/pickaxe" and "minecraft:needs_iron_tool"). Outcome: - The block now behaves like a stone-type material. - Players can mine it efficiently with an iron pickaxe or stronger. - Breaking it with the wrong tool or by hand is slow and yields no drops.
Click here for installation instructions
This mod is licensed under the CreativeMode Mods License.