Item entities

This commit is contained in:
2026-09-25 16:26:45 -03:00
parent 5fb23cf404
commit a254b96f65
18 changed files with 797 additions and 94 deletions
+4 -3
View File
@@ -204,7 +204,7 @@ program**, so the server and each client can number blocks differently. Saves an
| `mining.toughness` | unbreakable | `toughness` | Seconds to break by hand. A matching tool is 2× faster. |
| `mining.tool` | none | `tool_to_break` | Tool type that speeds it up, like `pickaxe`, `axe` or `shovel`. |
| `mining.requires_tool` | `false` | `requires_tool` | Only drops when broken with `mining.tool`. |
| `drops` | nothing | `drop_table` | Item id given when broken. |
| `drops` | nothing | `drop_table` | Item id dropped on the ground when broken, for players to pick up. |
| `item` | `true` | `register_block_item` | Also register an item that places this block, with the same id. |
| `interactive` | `false` | `interactive` | Right clicking it does something (opens a screen), so clients don't guess it places a block. |
| `replaceable` | `false` | new | Placing a block into it replaces it, like water. |
@@ -408,6 +408,7 @@ interface Player {
readonly inventory: Container; // 36 slots, hotbar is 0-8
readonly selected_slot: number;
readonly held_item: ItemStack | undefined;
// what doesn't fit in the inventory drops at their feet
give_item(id: string, count?: number, data?: unknown): void;
send_message(text: string): void;
teleport(x: number, y: number, z: number): void;
@@ -852,8 +853,8 @@ client server
│ │
│ ready │
├────────────────────────────────────────►│
│ join { id, name, players, changes, │ the player is created here, player_join fires,
│ spawn, selected_slot } │ and their inventory follows as container messages
│ join { id, name, players, entities, │ the player is created here, player_join fires,
│ changes, spawn, selected_slot } │ and their inventory follows as container messages
│◄────────────────────────────────────────┤
```