pub struct PersistentPlayerData {Show 29 fields
pub pos: [f64; 3],
pub motion: [f64; 3],
pub rotation: [f32; 2],
pub on_ground: bool,
pub fall_flying: bool,
pub remaining_fire_ticks: i32,
pub ticks_frozen: i32,
pub is_in_powder_snow: bool,
pub was_in_powder_snow: bool,
pub has_visual_fire: bool,
pub health: f32,
pub game_mode: i32,
pub prev_game_mode: Option<i32>,
pub abilities: PersistentAbilities,
pub inventory: Vec<PersistentSlot>,
pub selected_slot: i32,
pub world: String,
pub food_level: i32,
pub food_saturation_level: f32,
pub food_exhaustion_level: f32,
pub food_tick_timer: i32,
pub data_version: i32,
pub experience_level: i32,
pub experience_progress: f32,
pub experience_total: i32,
pub score: i32,
pub seen_credits: bool,
pub root_vehicle: Option<PersistentRootVehicle>,
pub ender_pearls: Vec<PersistentEnderPearl>,
}Expand description
Persistent player data saved by Steel’s storage backend.
This is Steel’s runtime save snapshot. Vanilla import/export should live outside server runtime storage so compatibility logic does not constrain the native format.
Fields§
§pos: [f64; 3]Position (x, y, z) in absolute world coordinates.
motion: [f64; 3]Velocity (x, y, z) in blocks per tick.
rotation: [f32; 2]Rotation (yaw, pitch) in degrees.
on_ground: boolWhether the player is on the ground.
fall_flying: boolWhether the player is elytra gliding.
remaining_fire_ticks: i32Vanilla remainingFireTicks.
ticks_frozen: i32Synchronized vanilla TicksFrozen.
is_in_powder_snow: boolVanilla isInPowderSnow.
was_in_powder_snow: boolVanilla wasInPowderSnow.
has_visual_fire: boolVanilla hasVisualFire.
health: f32Current health points.
game_mode: i32Current game mode (0=survival, 1=creative, 2=adventure, 3=spectator).
prev_game_mode: Option<i32>Previous game mode of the player, or None if vanilla has not recorded one yet.
abilities: PersistentAbilitiesPlayer abilities (flight, invulnerability, etc.).
inventory: Vec<PersistentSlot>Inventory items with slot indices.
selected_slot: i32Currently selected hotbar slot (0-8).
world: StringLoaded world identifier (e.g., “minecraft:overworld”).
food_level: i32Current food level (0–20, default 20).
food_saturation_level: f32Food saturation level (0.0–food_level, default 5.0).
food_exhaustion_level: f32Accumulated food exhaustion (0.0–40.0, default 0.0).
food_tick_timer: i32Internal tick timer for regen/starvation (default 0).
data_version: i32Data version for format migrations.
experience_level: i32Current experience level
experience_progress: f32Vanilla progress toward the next experience level.
experience_total: i32Vanilla Player.totalExperience, updated by point grants but independent of level/progress.
score: i32Vanilla death-screen score. Point grants change it with Java int wrapping.
seen_credits: boolVanilla ServerPlayer.seenCredits.
root_vehicle: Option<PersistentRootVehicle>Vanilla one-player root vehicle tree stored with the player instead of chunk data.
ender_pearls: Vec<PersistentEnderPearl>Vanilla in-flight ender pearls stored with the player (ServerPlayer.enderPearls).
Implementations§
Source§impl PersistentPlayerData
impl PersistentPlayerData
Sourcepub fn from_player(player: &Player) -> Self
pub fn from_player(player: &Player) -> Self
Extracts persistent data from a live player.
Sourcefn ender_pearls_from_player(player: &Player) -> Vec<PersistentEnderPearl>
fn ender_pearls_from_player(player: &Player) -> Vec<PersistentEnderPearl>
Snapshots the player’s live in-flight ender pearls for persistence.
fn root_vehicle_from_player(player: &Player) -> Option<PersistentRootVehicle>
Source§impl PersistentPlayerData
impl PersistentPlayerData
Sourcepub fn apply_to_player(&self, player: &Player)
pub fn apply_to_player(&self, player: &Player)
Applies the saved data to a player.
This restores position, rotation, inventory, abilities, etc.
Sourcepub fn apply_to_player_without_location(&self, player: &Player)
pub fn apply_to_player_without_location(&self, player: &Player)
Applies saved gameplay state without restoring world-local location data.
Used when the saved world is unavailable or differs from an explicitly selected world, which must use the target spawn instead.
fn apply_to_player_inner(&self, player: &Player, restore_location: bool)
Trait Implementations§
Source§impl Clone for PersistentPlayerData
impl Clone for PersistentPlayerData
Source§fn clone(&self) -> PersistentPlayerData
fn clone(&self) -> PersistentPlayerData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PersistentPlayerData
impl !UnwindSafe for PersistentPlayerData
impl Freeze for PersistentPlayerData
impl Send for PersistentPlayerData
impl Sync for PersistentPlayerData
impl Unpin for PersistentPlayerData
impl UnsafeUnpin for PersistentPlayerData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>