ctx.items.damage and player_death event moved to bworld

This commit is contained in:
2026-11-14 00:09:55 -03:00
parent 9bf6b98953
commit 6c6be61dd0
7 changed files with 34 additions and 14 deletions
+6
View File
@@ -1002,6 +1002,12 @@ export class ModRuntime {
if (!item) throw new Error(`unknown item ${id}`);
return item.tool?.type;
},
damage: (item, amount) => {
const stack = EngineItemStack.from_data(item);
const used_up = stack.damage(amount);
item.data = stack.data;
return used_up;
},
sell_value: shared_items_api(mod, this.fluid_rules).sell_value,
components: (id) => {
const item = EverythingRegistry.get<ItemRegistry>("items", id);