Curios slots rendering !

This commit is contained in:
2026-10-01 17:57:22 -03:00
parent ea9f3f61bb
commit f2c3cb8135
39 changed files with 1032 additions and 226 deletions
+10
View File
@@ -26,6 +26,7 @@ interface Player {
give_item(id: string, count?: number, data?: unknown): void; // what doesn't fit drops at their feet
send_message(text: string): void;
set_worn(key: string, items: ItemStack[]): void; // what's drawn on them, see Worn Items
teleport(x: number, y: number, z: number): void;
readonly health: number; // out of max_health
@@ -92,6 +93,15 @@ Like Minecraft, an attack right after the last one, or right after changing the
damage, rising to full after `20 / attack_speed` ticks. A bar under the crosshair shows it filling up, and the server
sends players their `attack_speed` whenever it changes so the bar matches.
## Worn Items
`set_worn(key, items)` says what a mod shows on a player, like the base game's curios slots do for what's in them. Each
mod uses its own key, like `"bworld:curios"`, and setting a key replaces its list, `[]` clears it. Only items whose JSON
has [`worn`](../items/index.md#worn-models) show.
Everyone is told what each player wears, the player too, and players joining later get it with the others. It isn't
saved: set it again when the player joins, the way the curios slots do.
## Death
When a player dies, everything they carried falls out where they died, and their tools lose durability (see