Player api

This commit is contained in:
2026-10-13 22:59:48 -03:00
parent b34e97e487
commit a10b15a3fd
22 changed files with 581 additions and 89 deletions
+6 -2
View File
@@ -93,19 +93,23 @@ export interface SharedBlock extends Position {
}
// a player placing a block at x y z by clicking face of the block next to it, at hit (0 to 1 on each axis of that
// block), like minecraft's BlockPlaceContext. facing is the way the player looks, along the ground
// block), like minecraft's BlockPlaceContext. facing is the way the player looks, along the ground, and sneaking
// whether they hold the sneak key, for blocks placed another way round when they do
export interface BlockPlacement extends Position {
readonly face: Face;
readonly hit: readonly [number, number, number];
readonly facing: "north" | "east" | "south" | "west";
readonly sneaking: boolean;
}
// a player right clicking face of a block, at hit (0 to 1 on each axis of the block), like minecraft's BlockHitResult.
// facing is the way the player looks, along the ground
// facing is the way the player looks, along the ground, and sneaking whether they hold the sneak key. sneaking with
// an item in hand doesn't interact at all, the item is used or placed instead
export interface BlockInteraction {
readonly face: Face;
readonly hit: readonly [number, number, number];
readonly facing: "north" | "east" | "south" | "west";
readonly sneaking: boolean;
}
// P is the component's params from the block json