This commit is contained in:
2026-10-28 22:26:42 -03:00
parent b8cccb86ff
commit 5d64b801a3
14 changed files with 480 additions and 12 deletions
+6
View File
@@ -26,6 +26,8 @@ export interface EntityHost {
on_entity_death?(entity: Entity, source: DamageSource): void;
// what it drops when it dies, from its loot table
entity_loot?(entity: Entity, source: DamageSource): ItemStack[];
// see EntityLevel.stands_on
stands_on?(entity: Entity, x: number, y: number, z: number): void;
}
// what a client was last told about an entity, so only changes get sent
@@ -172,6 +174,10 @@ export class EntityManager implements EntityLevel {
return this.#host.entity_loot?.(entity, source) ?? [];
}
stands_on(entity: Entity, x: number, y: number, z: number) {
this.#host.stands_on?.(entity, x, y, z);
}
// ticking
// every entity active says should move, with their passengers. entities removed along the way are forgotten