Fluid containers
This commit is contained in:
@@ -29,6 +29,7 @@ interface Player {
|
||||
readonly held_item: ItemStack | undefined;
|
||||
|
||||
give_item(id: string, count?: number, data?: unknown): void; // what doesn't fit drops at their feet
|
||||
exchange_held(result: ItemStack): void; // one of the held item becomes result, see below
|
||||
send_message(text: string, options?: { overlay?: boolean }): void; // in chat, or above the hotbar with overlay
|
||||
set_worn(key: string, items: ItemStack[]): void; // what's drawn on them, see Worn Items
|
||||
teleport(x: number, y: number, z: number): void;
|
||||
@@ -63,6 +64,10 @@ interface Player {
|
||||
`inventory` is a live [container](../inventories/containers.md), and `held_item` a live stack: changing them changes
|
||||
what the player has.
|
||||
|
||||
`exchange_held(result)` is for an item that turns into another when used, like an empty bucket filling: one of the held
|
||||
stack goes, and `result` goes straight into their hand when that was the last one, or into their inventory (at their
|
||||
feet when it's full) when there are more.
|
||||
|
||||
`eye_position` and `look_direction` are for aiming. With [`ctx.world.raycast`](../blocks/index.md#raycasts) they find
|
||||
what a player is looking at, like Minecraft's `getPlayerPOVHitResult`:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user