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
+7
View File
@@ -58,6 +58,11 @@ export class ServerPlayer extends LivingEntity {
override eye_height = PLAYER_EYE_HEIGHT;
// lying flat in the short box, as their client says. their client decides, like where they are
swimming = false;
// holding the sneak key, as their client says
sneaking = false;
// the held item they're using over time, like drawing a bow: which slot and item it was, how many ticks they've
// used it, and for how long they can (-1 until they let go). see GameServer.start_using
using: { slot: number; type_id: string; ticks: number; duration: number } | undefined;
// flying, from /fly. their client moves them without gravity, and they don't fall or get hungry from moving
flying = false;
@@ -127,6 +132,8 @@ export class ServerPlayer extends LivingEntity {
[ATTRIBUTES.attack_speed],
[ATTRIBUTES.physical_shielding],
[ATTRIBUTES.arcane_shielding],
[ATTRIBUTES.block_interaction_range],
[ATTRIBUTES.entity_interaction_range],
];
}