pub struct PlayerInfo {
pub uuid: Uuid,
pub entity_id: i32,
pub username: String,
pub rotation: Rotation,
pub position: Position,
}Expand description
Identity and state of the player who triggered an action.
Constructed by the server when creating a dispatch context.
Plugin handlers access this via ctx.player().
Fields§
§uuid: UuidPlayer UUID (from Mojang or offline-mode).
entity_id: i32Protocol entity ID.
username: StringPlayer display name.
rotation: RotationCurrent facing direction.
position: PositionCurrent world position. Read at context-construction time, so it reflects the player’s location when the event fired — stale by the next tick.
Implementations§
Source§impl PlayerInfo
impl PlayerInfo
Sourcepub fn stub() -> Self
pub fn stub() -> Self
Returns a sentinel PlayerInfo for system-level dispatches.
Used during plugin loading when the dispatch context exists but
no player is involved (e.g. recipe registry lifecycle events).
The entity_id is -1, the username is "<system>", and all
position / rotation fields are zero. Plugin handlers receiving
these dispatches must not rely on ctx.player() data — the
event payload carries everything they need.
Trait Implementations§
Source§impl Clone for PlayerInfo
impl Clone for PlayerInfo
Source§fn clone(&self) -> PlayerInfo
fn clone(&self) -> PlayerInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more