wyrt_loot

v1.0.0Inventory

Dropped item management with player instancing, despawn timers, and loot tables

Features

  • Ground item spawning and despawning
  • Player-instanced loot (personal drops)
  • Loot table rolling with weighted chances
  • Automatic cleanup of expired items
  • Loot pickup radius detection
  • Broadcasting dropped items to nearby players

Quick Start

const lootModule = context.getModule('wyrt_loot');
const lootSystem = lootModule.createLootSystem('my_game');

// Drop loot on mob death
lootSystem.dropLoot({
  x: mob.x, y: mob.y,
  items: [{ itemId: 'gold_coin', quantity: 10 }],
  instancedTo: killerId,  // Only this player can pick up
  despawnTime: 60000      // 1 minute
});

// Roll from a loot table
const drops = lootSystem.rollLootTable('goblin_loot');

Exports

LootSystem

Manages ground items and loot tables