Lilium Backpacks - V1.2.0.mcaddon
What's new
Changelog - Lilium Backpacks
[1.2.0]
Added
- Vector 3D Utility Framework Module: Added
api/Vector.jsproviding full 3D vector operations (vector addition, subtraction, scalar multiplication, 3D distance, 2D XZ distance, and unit normalization). - ItemStack Serialization Helper: Added
api/ItemSerializer.js(serializeItem&parseItem) to convert complexItemStackinstances with lore, nameTags, durability, and dynamic properties to/from plain JSON format. - Container & Durability Utilities: Added
api/ContainerUtils.jsfor container slot validation and gamemode-aware item durability consumption. - Dedicated Security Guards Domain Module: Created
modules/SecurityGuards.jsto isolate ownership access checks (preventing non-owners from opening backpacks) and entity cleanup tasks.
Changed
- Unified Main Entry Point Architecture: Refactored
main.jsto serve as the single primary entry point, cleanly registering runtime entities and delegating logic to domain modules. - Modular Domain Architecture: Reorganized all business logic into isolated, single-responsibility domain modules inside
BP/scripts/modules/. - Block Creative Category Hidden: Updated
BP/blocks/backpack_block.jsonmenu category to"category": "none", hiding the technical backpack block from the creative menu.
Optimized
- Bounded Spatial Queries: Replaced unbounded dimension-wide entity searches (
dimension.getEntities({ type })) with localized spatial queries (location+maxDistance), improving performance in worlds with multiple active backpacks. - Dynamic Property Proxy & Event Loop: Streamlined
EntityRuntime.jsproxy interception for array mutations (push,splice,sort) and event loop execution.
Fixed
- Placed Backpack Entity Spawning & Interactivity: Fixed bounding box area (
from/to) insaveBackpackStructuresostructureManagerencloses the entity properly. Placed backpacks now correctly spawn their interactablelb:backpack_entityin block mode (lb:in_block = true) upon placement and allow opening their inventory. - Backpack Item Drop on Block Break: Fixed
onBreakcustom component handling inmodules/PlacementSystem.jsandmodules/BackpackEntity.jsto reliably spawn the dropped backpackItemStackwith preservedbackpack_id,owner, and lore when destroyed. - ScriptEvent Argument Parsing Bug: Fixed critical bug in
api/EntityRuntime.js(line 258) insidesystem.afterEvents.scriptEventReceivewhere numerical arguments were incorrectly reassigned tomsginstead of appended to theargsarray.
This mod has no additional files

