Hitting !!

This commit is contained in:
2026-09-30 15:41:30 -03:00
parent 3af5f6e54b
commit 5e2b415f5c
9 changed files with 82 additions and 7 deletions
+5 -1
View File
@@ -7,7 +7,7 @@ export const AIR_ID = "bworld:air";
// bump when a client and server of different versions can't play together.
// the server rejects a different version before the client downloads anything
export const PROTOCOL_VERSION = 10;
export const PROTOCOL_VERSION = 12;
export interface PlayerInfo {
id: string;
@@ -90,6 +90,8 @@ export type ClientMessage =
| { type: "hit_block"; x: number; y: number; z: number }
// left click on an entity, by id
| { type: "attack_entity"; id: string }
// left click at nothing, a swing at the air. it starts the attack cooldown over, like an attack
| { type: "swing" }
// right click without looking at a block, for items' on_use
| { type: "use_item" }
// right click on a block: interact with it, or place the held block against `face`
@@ -190,6 +192,8 @@ export type ServerMessage =
| { type: "suggestions"; id: number; start: number; suggestions: { text: string; tooltip?: string }[] }
// the player's own health, hunger and saturation, when they change
| { type: "vitals"; health: number; food: number; saturation: number }
// the player's own attack speed attribute, when it changes, for the attack indicator under the crosshair
| { type: "attack_speed"; value: number }
// a mod's server script talking to its client script, see ctx.net
| { type: "mod"; channel: string; data: unknown };