Loot tables

This commit is contained in:
2026-10-08 00:54:45 -03:00
parent 757ee74bc7
commit ec2b53c02a
45 changed files with 1733 additions and 150 deletions
+5 -2
View File
@@ -374,8 +374,11 @@ export abstract class LivingEntity extends Entity {
this.level.on_death(this, source);
}
// what it drops when it dies, each kind decides. spawn_at_location drops something where it is
drop_loot(_source: DamageSource) {}
// what it drops when it dies: its type's loot table, see EntityJson.loot_table. spawn_at_location drops
// something where it is
drop_loot(source: DamageSource) {
for (const stack of this.level.entity_loot(this, source)) this.spawn_at_location(stack);
}
// mobs drop their equipment, see Mob
drop_equipment(_source: DamageSource) {}