ctx.items.damage and player_death event moved to bworld
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user