Fly command

This commit is contained in:
2026-10-02 18:45:08 -03:00
parent 043c526c9c
commit a4fec0681f
7 changed files with 69 additions and 6 deletions
+6
View File
@@ -33,6 +33,8 @@ export interface SavedPlayer {
// base64 png, see /skin
skin?: string;
slim?: boolean;
// see /fly
flying?: boolean;
}
// the most ticks the server moves a knocked back player, in case they never land, like in water
@@ -53,6 +55,8 @@ 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;
// flying, from /fly. their client moves them without gravity, and they don't fall or get hungry from moving
flying = false;
inventory = new Container(INVENTORY_SIZE);
// hunger and saturation, health is the entity's
@@ -225,6 +229,7 @@ export class ServerPlayer extends LivingEntity {
vitals: { health: this.health, ...this.vitals.save() },
skin: this.skin,
slim: this.slim || undefined,
flying: this.flying || undefined,
};
}
@@ -240,5 +245,6 @@ export class ServerPlayer extends LivingEntity {
this.load_health(saved.vitals?.health ?? this.max_health);
this.skin = saved.skin;
this.slim = saved.slim ?? false;
this.flying = saved.flying === true;
}
}