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
+14
View File
@@ -246,6 +246,20 @@ export class GameServer {
on_entity_death: (entity, source) => {
if (entity instanceof ServerPlayer) this.#kill(entity, source);
},
stands_on: (entity, x, y, z) => {
const id = this.world.get_block_id(x, y, z);
const components = this.mods.components_with(id, "on_entity_stand");
if (components.length === 0) return;
const block = this.mods.block_ref(x, y, z, id);
for (const { mod, id: component_id, component, params } of components) {
if (entity.removed) return;
run_guarded(
mod,
`${component_id} on_entity_stand`,
() => component.on_entity_stand!(block, params, entity_ref(entity)),
);
}
},
entity_loot: (entity, source) => {
const table = EverythingRegistry.get<EntityJson>("entities", entity.type)?.loot_table;
if (!table) return [];