pub struct Player {Show 36 fields
pub gameprofile: GameProfile,
pub connection: Arc<PlayerConnection>,
pub world: ArcSwap<World>,
pub(crate) server: Weak<Server>,
pub(crate) config: Arc<RuntimeConfig>,
base: EntityBase,
lifecycle: SyncMutex<PlayerLifecycleState>,
pub(crate) movement: SyncMutex<MovementState>,
entity_data: SyncMutex<PlayerEntityData>,
pub last_chunk_pos: SyncMutex<ChunkPos>,
pub last_tracking_view: SyncMutex<Option<PlayerChunkView>>,
pub chunk_sender: SyncMutex<ChunkSender>,
client_information: SyncMutex<ClientInformation>,
pub chat: SyncMutex<ChatState>,
game_modes: SyncMutex<PlayerGameModeState>,
pub inventory: Shared<PlayerInventory>,
inventory_sync: SyncMutex<PlayerInventorySyncState>,
last_item_in_main_hand: SyncMutex<ItemStack>,
inventory_menu: SyncMutex<Menu>,
open_menu: SyncMutex<OpenMenuState>,
container_counter: SyncMutex<ContainerCounter>,
teleport_state: SyncMutex<TeleportState>,
item_cooldowns: SyncMutex<ItemCooldowns>,
tick_state: SyncMutex<PlayerTickState>,
pub abilities: SyncMutex<Abilities>,
pub block_breaking: SyncMutex<BlockBreakingManager>,
living_base: LivingEntityBase,
pub food_data: SyncMutex<FoodData>,
health_sync: SyncMutex<HealthSyncState>,
pub experience: SyncMutex<Experience>,
permissions: SyncMutex<PlayerPermissionState>,
seen_credits: SyncMutex<bool>,
won_game: SyncMutex<bool>,
pub chunk_send_epoch: SyncMutex<u32>,
residence: SyncMutex<PlayerResidenceState>,
ender_pearls: SyncMutex<Vec<Weak<dyn Entity>>>,
}Expand description
A struct representing a player.
Fields§
§gameprofile: GameProfileThe player’s game profile.
connection: Arc<PlayerConnection>The player’s connection (abstracted for testing).
world: ArcSwap<World>The world the player is in.
server: Weak<Server>Reference to the server (for entity ID generation, etc.).
config: Arc<RuntimeConfig>Runtime configuration shared with the server.
base: EntityBaseCommon entity fields (id, uuid, position, rotation, removal, callback).
lifecycle: SyncMutex<PlayerLifecycleState>Client lifecycle flags.
movement: SyncMutex<MovementState>Movement tracking state
entity_data: SyncMutex<PlayerEntityData>Synchronized entity data (health, pose, flags, etc.) for network sync.
last_chunk_pos: SyncMutex<ChunkPos>The last chunk position of the player.
last_tracking_view: SyncMutex<Option<PlayerChunkView>>The last chunk tracking view of the player.
chunk_sender: SyncMutex<ChunkSender>The chunk sender for the player.
client_information: SyncMutex<ClientInformation>The client’s settings/information (language, view distance, chat visibility, etc.).
Updated when the client sends SClientInformation during config or play phase.
chat: SyncMutex<ChatState>Chat state: message counters, signature cache, validator, session, chain.
game_modes: SyncMutex<PlayerGameModeState>Current and previous game mode.
inventory: Shared<PlayerInventory>The player’s inventory container (shared with inventory_menu).
inventory_sync: SyncMutex<PlayerInventorySyncState>Logical inventory slots that must be resent directly to this player’s client.
last_item_in_main_hand: SyncMutex<ItemStack>Last main-hand stack used for vanilla attack-strength reset checks.
The player’s inventory menu (always open, even when container_id is 0).
The currently open menu (None if player inventory is open).
This is separate from inventory_menu which is always present.
container_counter: SyncMutex<ContainerCounter>Counter for generating container IDs (1-100, wraps around).
teleport_state: SyncMutex<TeleportState>Pending server-initiated teleport state (ID, position, timeout).
item_cooldowns: SyncMutex<ItemCooldowns>Vanilla item use cooldown groups.
tick_state: SyncMutex<PlayerTickState>Local tick and once-per-tick packet state.
abilities: SyncMutex<Abilities>Player abilities (flight, invulnerability, build permissions, speeds, etc.)
block_breaking: SyncMutex<BlockBreakingManager>Block breaking state machine.
living_base: LivingEntityBaseShared living-entity runtime fields (attributes, speed, damage/death state).
Vanilla: LivingEntity (L230-232) + Entity.invulnerableTime (L256).
food_data: SyncMutex<FoodData>Player food/hunger state (food level, saturation, exhaustion).
health_sync: SyncMutex<HealthSyncState>Delta-tracking state for CSetHealth deduplication.
experience: SyncMutex<Experience>The Player’s Experience
permissions: SyncMutex<PlayerPermissionState>Assigned groups, direct overrides, and the effective permission set.
seen_credits: SyncMutex<bool>Whether the player has completed the vanilla End credits flow.
won_game: SyncMutex<bool>Vanilla ServerPlayer.wonGame; transient while the End credits screen is open.
chunk_send_epoch: SyncMutex<u32>Monotonic counter bumped on world teleport/reset. The chunk sending tick snapshots this before encoding and compares after to detect stale batches.
residence: SyncMutex<PlayerResidenceState>Domain-residence identity and persisted entities awaiting restoration.
ender_pearls: SyncMutex<Vec<Weak<dyn Entity>>>In-flight ender pearls thrown by this player, kept weakly so they persist
with the player and re-spawn on login (vanilla ServerPlayer.enderPearls).
Implementations§
Source§impl Player
impl Player
Sourcepub fn send_abilities(&self)
pub fn send_abilities(&self)
Sends the player abilities packet to the client. This tells the client about flight, invulnerability, speeds, etc.
Sourcepub fn is_flying(&self) -> bool
pub fn is_flying(&self) -> bool
Returns true if the player is flying (creative/spectator flight).
Sourcepub fn set_flying(&self, flying: bool)
pub fn set_flying(&self, flying: bool)
Sets the player’s flying state.
Sourcepub fn get_flying_speed(&self) -> f32
pub fn get_flying_speed(&self) -> f32
Returns the player’s flying speed.
Sourcepub fn set_flying_speed(&self, speed: f32)
pub fn set_flying_speed(&self, speed: f32)
Sets the player’s flying speed.
Sourcepub fn get_abilities(&self) -> Abilities
pub fn get_abilities(&self) -> Abilities
Returns a copy of the player’s abilities.
Sourcepub fn handle_player_abilities(&self, packet: SPlayerAbilities)
pub fn handle_player_abilities(&self, packet: SPlayerAbilities)
Handles the player abilities packet from the client. This is sent when the player starts or stops flying.
Source§impl Player
impl Player
Sourcepub fn tick_spam_throttlers(&self)
pub fn tick_spam_throttlers(&self)
Decays the per player chat and command spam counters once per server tick
const fn should_disconnect_for_rate_spam( throttler: &mut TickThrottler, is_operator: bool, ) -> bool
Sourcepub fn detect_command_rate_spam(&self)
pub fn detect_command_rate_spam(&self)
Applies Vanilla command spam accounting after a command is handled
fn detect_chat_rate_spam(&self)
Sourcepub fn get_and_increment_messages_received(&self) -> i32
pub fn get_and_increment_messages_received(&self) -> i32
Gets the next messages_received counter and increments it
fn verify_chat_signature( &self, packet: &SChat, ) -> Result<(SignedMessageLink, LastSeen), String>
Sourcepub fn handle_chat(&self, packet: SChat, player: Arc<Player>)
pub fn handle_chat(&self, packet: SChat, player: Arc<Player>)
Handles a chat message from the player.
Sourcepub fn send_message(&self, text: &TextComponent)
pub fn send_message(&self, text: &TextComponent)
Sends a system message to the player.
Sourcepub fn set_chat_session(&self, session: RemoteChatSession)
pub fn set_chat_session(&self, session: RemoteChatSession)
Updates the player’s chat session and initializes the message chain.
This should be called when receiving a ChatSessionUpdate packet from the client.
Sourcepub fn chat_session(&self) -> Option<RemoteChatSession>
pub fn chat_session(&self) -> Option<RemoteChatSession>
Gets a reference to the player’s chat session if present
Sourcepub fn has_chat_session(&self) -> bool
pub fn has_chat_session(&self) -> bool
Checks if the player has a valid chat session
Sourcepub fn handle_chat_session_update(&self, packet: SChatSessionUpdate)
pub fn handle_chat_session_update(&self, packet: SChatSessionUpdate)
Handles a chat session update packet from the client.
This validates the player’s profile key and initializes signed chat if valid.
Sourcepub fn handle_chat_ack(&self, packet: SChatAck)
pub fn handle_chat_ack(&self, packet: SChatAck)
Handles a chat acknowledgment packet from the client.
Source§impl Player
impl Player
Sourcepub fn send_packet<P: ClientPacket>(&self, packet: P)
pub fn send_packet<P: ClientPacket>(&self, packet: P)
Sends a packet to the player’s connection.
This is a generic helper that encodes the packet and delegates to the
connection’s send_encoded method, enabling object-safe packet sending.
§Panics
Panics if the packet fails to encode.
Sourcepub fn send_bundle<F>(&self, f: F)where
F: FnOnce(&mut BundleBuilder),
pub fn send_bundle<F>(&self, f: F)where
F: FnOnce(&mut BundleBuilder),
Sends multiple packets as an atomic bundle.
The closure receives a BundleBuilder to add packets to.
All packets are encoded, then sent wrapped in bundle delimiters so the
client processes them together in a single game tick.
Sourcepub fn disconnect(&self, reason: impl Into<TextComponent>)
pub fn disconnect(&self, reason: impl Into<TextComponent>)
Disconnects the player with a reason message.
Sourcepub fn close_connection(&self)
pub fn close_connection(&self)
Marks the player’s connection as closed without sending a disconnect packet.
Used during shutdown so that container-close logic treats the player as disconnected — dropping open-menu contents into the world instead of the saved inventory, matching vanilla’s removal-on-shutdown behavior.
Sourcepub fn handle_client_information(&self, packet: SClientInformation)
pub fn handle_client_information(&self, packet: SClientInformation)
Handles client information updates during play phase.
Sourcepub fn client_information(&self) -> ClientInformation
pub fn client_information(&self) -> ClientInformation
Returns the player’s client information settings.
Sourcepub fn set_client_information(&self, info: ClientInformation)
pub fn set_client_information(&self, info: ClientInformation)
Updates the player’s client information settings.
Sourcepub fn view_distance(&self) -> u8
pub fn view_distance(&self) -> u8
Returns the effective view distance for this player.
This is the minimum of the client’s requested view distance and the server’s configured maximum view distance.
Source§impl Player
impl Player
Sourcepub(super) const fn dimensions_for_pose(pose: EntityPose) -> EntityDimensions
pub(super) const fn dimensions_for_pose(pose: EntityPose) -> EntityDimensions
Returns vanilla Avatar.POSES dimensions for a player pose.
fn bounding_box_for_pose(&self, pose: EntityPose) -> WorldAabb
fn can_player_fit_within_blocks_and_entities_when( &self, pose: EntityPose, ) -> bool
pub(super) fn reset_entity_state(&self)
Sourcepub fn is_crouching(&self) -> bool
pub fn is_crouching(&self) -> bool
Returns true if the player is shifting (sneaking).
Sourcepub fn set_crouching(&self, crouching: bool)
pub fn set_crouching(&self, crouching: bool)
Sets whether the player is shifting (sneaking).
Sourcepub fn is_swimming(&self) -> bool
pub fn is_swimming(&self) -> bool
Returns true if vanilla player rules consider the player swimming.
Sourcepub fn is_fall_flying(&self) -> bool
pub fn is_fall_flying(&self) -> bool
Returns true if the player is currently fall flying (elytra).
Sourcepub(super) fn on_climbable(&self) -> bool
pub(super) fn on_climbable(&self) -> bool
Returns true if vanilla rules consider this player to be on a climbable block.
Sourcepub fn set_fall_flying(&self, fall_flying: bool)
pub fn set_fall_flying(&self, fall_flying: bool)
Sets the player’s fall flying state.
Sourcepub(super) fn get_desired_pose(&self) -> EntityPose
pub(super) fn get_desired_pose(&self) -> EntityPose
Determines the desired pose based on current player state.
Priority: Sleeping > Swimming > FallFlying > Sneaking > Standing
Sourcepub(super) fn update_pose(&self)
pub(super) fn update_pose(&self)
Updates the player’s pose in entity data based on current state.
Source§impl Player
impl Player
fn increase_score(&self, amount: i32)
Sourcepub(crate) fn give_experience_points(&self, points: i32)
pub(crate) fn give_experience_points(&self, points: i32)
Gives raw experience points to this player.
Sourcepub(crate) fn give_experience_levels(&self, levels: i32)
pub(crate) fn give_experience_levels(&self, levels: i32)
Gives experience levels to this player.
fn play_experience_level_up_sound(&self, level: i32)
Sourcepub(super) fn advance_tick(&self)
pub(super) fn advance_tick(&self)
Advances this player’s local server tick count.
Source§impl Player
impl Player
Sourcepub(super) fn tick_regeneration(&self)
pub(super) fn tick_regeneration(&self)
Ticks food/hunger regeneration and starvation.
Sourcepub fn cause_food_exhaustion(&self, amount: f32)
pub fn cause_food_exhaustion(&self, amount: f32)
Adds food exhaustion, gated by invulnerability.
Source§impl Player
impl Player
Sourcepub(super) fn block_action_restricted(
&self,
world: &World,
pos: BlockPos,
) -> bool
pub(super) fn block_action_restricted( &self, world: &World, pos: BlockPos, ) -> bool
Mirrors vanilla Player.blockActionRestricted for block breaking.
fn can_break_block_in_adventure_mode( predicate: &AdventureModePredicate, world: &World, pos: BlockPos, ) -> bool
Source§impl Player
impl Player
Sourcefn send_block_updates(&self, pos: BlockPos, direction: Direction)
fn send_block_updates(&self, pos: BlockPos, direction: Direction)
Sends block update packets for a position and its neighbor. Optionally also sends an update for an additional placement position (useful for items like buckets that place blocks at different positions).
Sourcepub fn swing(&self, hand: InteractionHand, update_self: bool)
pub fn swing(&self, hand: InteractionHand, update_self: bool)
Triggers arm swing animation and broadcasts it to tracking players.
Sourcepub fn handle_use_item_on(&self, packet: SUseItemOn)
pub fn handle_use_item_on(&self, packet: SUseItemOn)
Handles the use of an item on a block.
Implements the logic from Java’s ServerGamePacketListenerImpl.handleUseItemOn().
Sourcepub fn handle_player_action(&self, packet: SPlayerAction)
pub fn handle_player_action(&self, packet: SPlayerAction)
Handles a player action packet (block breaking, item dropping, etc.).
Sourcepub fn handle_pick_item_from_block(&self, packet: SPickItemFromBlock)
pub fn handle_pick_item_from_block(&self, packet: SPickItemFromBlock)
Handles the pick block action (middle click on a block).
§Panics
Panics if the behavior registry has not been initialized.
Sourcepub fn handle_sign_update(&self, packet: SSignUpdate)
pub fn handle_sign_update(&self, packet: SSignUpdate)
Handles a sign update packet from the client.
Sourcepub fn open_sign_editor(&self, pos: BlockPos, is_front_text: bool)
pub fn open_sign_editor(&self, pos: BlockPos, is_front_text: bool)
Opens the sign editor for the player.
§Arguments
pos- Position of the sign blockis_front_text- Whether to edit front (true) or back (false) text
Source§impl Player
impl Player
fn invalid_entity_attacked_message() -> TextComponent
fn eye_position(&self) -> DVec3
fn damage_source_for_attack_type( &self, damage_type: &'static DamageType, ) -> DamageSource
fn attack_damage_source(&self, attacking_item: &ItemStack) -> DamageSource
Sourcepub(in player) fn tick_attack_strength(
&self,
)
pub(in player) fn tick_attack_strength( &self, )
Ticks vanilla attack-strength recovery and resets it on main-hand item changes.
fn reset_attack_strength_ticker(&self)
fn current_item_attack_strength_delay(&self) -> f32
fn attack_strength_delay_from_speed(attack_speed: f64) -> f32
Sourcepub fn attack_strength_scale(&self, partial_tick: f32) -> f32
pub fn attack_strength_scale(&self, partial_tick: f32) -> f32
Returns vanilla Player.getAttackStrengthScale.
fn attack_strength_scale_for_delay( &self, partial_tick: f32, attack_strength_delay: f32, ) -> f32
fn base_damage_scale_factor(attack_strength_scale: f32) -> f32
fn get_knockback( attack_knockback: f64, weapon: &ItemStack, enchantment_context: &EnchantmentDamageContext<'_>, ) -> f64
fn cause_extra_knockback( &self, entity: &dyn Entity, knockback_amount: f64, old_movement: DVec3, )
fn entity_interaction_range(&self) -> f64
Sourcepub fn is_within_attack_range_with_buffer(
&self,
item_stack: &ItemStack,
aabb: WorldAabb,
buffer: f64,
) -> bool
pub fn is_within_attack_range_with_buffer( &self, item_stack: &ItemStack, aabb: WorldAabb, buffer: f64, ) -> bool
Returns true if the target box is within the player’s attack range for item_stack.
Sourcepub fn is_within_entity_interaction_range_with_buffer(
&self,
aabb: WorldAabb,
buffer: f64,
) -> bool
pub fn is_within_entity_interaction_range_with_buffer( &self, aabb: WorldAabb, buffer: f64, ) -> bool
Returns true if the target box is within the player’s entity interaction range.
fn attack_range_for_item(&self, item_stack: &ItemStack) -> (f64, f64, f64)
fn piercing_hit_entities( &self, item_stack: &ItemStack, world: &World, ) -> Vec<SharedEntity> ⓘ
fn can_piercing_hit_entity(&self, target: &dyn Entity) -> bool
pub(super) fn piercing_attack( &self, item_stack: &ItemStack, piercing_weapon: &PiercingWeapon, )
fn stab_attack( &self, target: &SharedEntity, base_damage: f32, deals_damage: bool, deals_knockback: bool, dismounts: bool, ) -> bool
fn play_sound_holder(&self, holder: Option<&SoundEventHolder>)
fn cannot_attack(&self, entity: &dyn Entity) -> bool
Sourcepub fn attack(&self, target: &SharedEntity) -> bool
pub fn attack(&self, target: &SharedEntity) -> bool
Attacks an entity with the player’s main-hand base damage.
Returns true if the target accepted damage.
fn item_attack_interaction( &self, entity: &dyn Entity, damage_source: &DamageSource, apply_to_target: bool, )
Sourcepub fn interact_on(
&self,
entity: &dyn Entity,
hand: InteractionHand,
location: DVec3,
) -> InteractionResult
pub fn interact_on( &self, entity: &dyn Entity, hand: InteractionHand, location: DVec3, ) -> InteractionResult
Interacts with an entity using the held item.
Sourcepub fn handle_attack(&self, packet: SAttack)
pub fn handle_attack(&self, packet: SAttack)
Handles a client request to attack an entity.
pub(super) fn cannot_attack_with_item( &self, item_stack: &ItemStack, tolerance: i32, ) -> bool
pub(super) fn is_invalid_attack_target( player_id: i32, target_id: i32, target_type: EntityTypeRef, ) -> bool
Sourcepub fn handle_interact(&self, packet: SInteract)
pub fn handle_interact(&self, packet: SInteract)
Handles a client request to interact with an entity.
Source§impl Player
impl Player
Sourcepub fn set_game_mode(&self, gamemode: GameType) -> bool
pub fn set_game_mode(&self, gamemode: GameType) -> bool
Sets the player’s game mode and notifies the client.
Returns true if the game mode was changed, false if the player was already in the requested game mode.
fn update_game_mode_invisibility(&self)
fn is_in_range_of_ground_for_flight_disable(&self) -> bool
Sourcepub fn send_difficulty(&self)
pub fn send_difficulty(&self)
Sends the current world difficulty to the client.
Sourcepub fn handle_change_difficulty(&self, difficulty: Difficulty)
pub fn handle_change_difficulty(&self, difficulty: Difficulty)
Handles a client request to change the world difficulty.
Sourcepub(in player) fn update_player_attributes(
&self,
)
pub(in player) fn update_player_attributes( &self, )
Updates interaction range attribute modifiers based on game mode.
Vanilla: ServerPlayer.updatePlayerAttributes() — applies creative-mode
range modifiers every tick.
Sourcepub fn has_infinite_materials(&self) -> bool
pub fn has_infinite_materials(&self) -> bool
Returns true if player has infinite materials (Creative mode).
Sourcepub fn ack_block_changes_up_to(&self, sequence: i32)
pub fn ack_block_changes_up_to(&self, sequence: i32)
Acknowledges block changes up to the given sequence number.
The ack is batched and sent once per tick (in tick_ack_block_changes),
matching vanilla behavior.
Sourcepub(in player) fn tick_ack_block_changes(
&self,
)
pub(in player) fn tick_ack_block_changes( &self, )
Sends pending block change ack if any. Called once per tick.
Sourcepub fn is_within_block_interaction_range(&self, pos: BlockPos) -> bool
pub fn is_within_block_interaction_range(&self, pos: BlockPos) -> bool
Returns true if player is within block interaction range.
Uses eye position and AABB distance (nearest point on block surface),
matching vanilla’s Player.isWithinBlockInteractionRange(pos, 1.0).
Sourcepub fn is_within_block_interaction_range_with_buffer(
&self,
pos: BlockPos,
buffer: f64,
) -> bool
pub fn is_within_block_interaction_range_with_buffer( &self, pos: BlockPos, buffer: f64, ) -> bool
Returns true if player is within block interaction range plus a vanilla buffer.
Sourcepub fn is_within_entity_interaction_range(
&self,
aabb: WorldAabb,
buffer: f64,
) -> bool
pub fn is_within_entity_interaction_range( &self, aabb: WorldAabb, buffer: f64, ) -> bool
Returns true if the player’s eye position is within entity interaction range.
Sourcepub fn handle_spectator_action(&self, packet: SSpectatorAction)
pub fn handle_spectator_action(&self, packet: SSpectatorAction)
Handles spectator camera selection.
Sourcepub fn is_secondary_use_active(&self) -> bool
pub fn is_secondary_use_active(&self) -> bool
Returns true if player is sneaking (secondary use active).
Source§impl Player
impl Player
Sourcepub fn reset_sent_info(&self)
pub fn reset_sent_info(&self)
Invalidates the delta-tracking state so that the next tick() will send
CSetHealth to the client (vanilla: resetSentInfo).
Source§impl Player
impl Player
Sourcepub fn is_item_on_cooldown(&self, stack: &ItemStack) -> bool
pub fn is_item_on_cooldown(&self, stack: &ItemStack) -> bool
Returns whether the stack’s vanilla cooldown group is currently active.
Sourcepub fn apply_item_use_cooldown(&self, stack: &ItemStack)
pub fn apply_item_use_cooldown(&self, stack: &ItemStack)
Starts the stack’s vanilla use_cooldown, if it has one.
pub(super) fn tick_item_cooldowns(&self)
Source§impl Player
impl Player
fn begin_respawn_request(&self) -> Option<PendingWorldChangeToken>
fn finish_respawn_request(&self, token: PendingWorldChangeToken)
fn finish_death_respawn( self: &Arc<Self>, source_world: &Arc<World>, target_world: &Arc<World>, spawn: DeathRespawnSpawn, pending_token: PendingWorldChangeToken, )
fn finish_end_credits_respawn( self: &Arc<Self>, source_world: &Arc<World>, target_world: &Arc<World>, spawn: DeathRespawnSpawn, pending_token: PendingWorldChangeToken, )
fn finish_failed_respawn( self: &Arc<Self>, target_world: &Arc<World>, pending_token: PendingWorldChangeToken, )
fn reset_state_for_death_respawn_during_world_change( &self, pending_token: PendingWorldChangeToken, )
fn reset_state_for_death_respawn_inner( &self, pending_token: Option<PendingWorldChangeToken>, )
fn detach_relationships_for_respawn(&self)
Sourcepub fn handle_client_command(self: &Arc<Self>, action: ClientCommandAction)
pub fn handle_client_command(self: &Arc<Self>, action: ClientCommandAction)
Handles client commands, requestStats and RequestGameRuleValues are still todo
Sourcepub(in player) const fn should_process_respawn(
health: f32,
) -> bool
pub(in player) const fn should_process_respawn( health: f32, ) -> bool
Vanilla accepts a client respawn request only when player health is dead-or-dying. Steel’s death-processed guard is not respawn authority.
Sourcepub fn has_seen_credits(&self) -> bool
pub fn has_seen_credits(&self) -> bool
Returns vanilla ServerPlayer.seenCredits.
Sourcepub fn set_seen_credits(&self, seen_credits: bool)
pub fn set_seen_credits(&self, seen_credits: bool)
Sets vanilla ServerPlayer.seenCredits.
Sourcepub(crate) fn has_won_game(&self) -> bool
pub(crate) fn has_won_game(&self) -> bool
Returns vanilla ServerPlayer.wonGame.
fn set_won_game(&self, won_game: bool)
Sourcepub(crate) fn show_end_credits(&self)
pub(crate) fn show_end_credits(&self)
Starts the vanilla End credits flow.
fn respawn_after_end_credits(self: &Arc<Self>)
Source§impl Player
impl Player
Sourcepub(crate) fn reset(
self: &Arc<Self>,
new_world: Arc<World>,
reason: ResetReason,
)
pub(crate) fn reset( self: &Arc<Self>, new_world: Arc<World>, reason: ResetReason, )
Resets the player’s transient state and prepares them for a new world.
This is the shared “clean slate” path used by initial join, respawn, and world change. If the player is currently in a different world, they are removed from the old world first.
Vanilla creates a fresh ServerPlayer for death and End-credits respawns,
but reuses it for dimension changes. Steel reuses the same Player for
every path, so this resets only the transient state appropriate to reason.
Sourcepub(crate) fn reset_after_detached_domain_restore<F>(
self: &Arc<Self>,
new_world: Arc<World>,
restore_state: F,
)where
F: FnOnce(),
pub(crate) fn reset_after_detached_domain_restore<F>(
self: &Arc<Self>,
new_world: Arc<World>,
restore_state: F,
)where
F: FnOnce(),
Resets a player already detached from its source domain and restores target-domain state.
fn reset_inner_after<F>(
self: &Arc<Self>,
new_world: Arc<World>,
reason: ResetReason,
source_world_detached: bool,
restore_state: F,
)where
F: FnOnce(),
Sourcepub(crate) fn spawn(
self: &Arc<Self>,
position: DVec3,
rotation: (f32, f32),
reason: ResetReason,
) -> bool
pub(crate) fn spawn( self: &Arc<Self>, position: DVec3, rotation: (f32, f32), reason: ResetReason, ) -> bool
Spawns the player into their current world at the given position.
This is the shared “enter world” path used by initial join, respawn, and world change. Sends position sync, abilities, inventory, time, weather, and adds the player to the world as appropriate for the given reason.
§Panics
Panics if the advance_time gamerule is not a bool.
pub(crate) fn spawn_with_velocity( self: &Arc<Self>, position: DVec3, rotation: (f32, f32), velocity: DVec3, reason: ResetReason, ) -> bool
pub(crate) fn spawn_with_velocity_packet( self: &Arc<Self>, position: DVec3, rotation: (f32, f32), velocity: DVec3, reason: ResetReason, packet_position: DVec3, packet_rotation: (f32, f32), packet_velocity: DVec3, relatives: RelativeMovement, ) -> bool
fn send_spawn_state_packets(&self, world: &World)
fn send_time_sync(&self, world: &World)
fn send_default_spawn_position(&self, world: &World)
fn send_weather_sync(&self, world: &World)
pub(in player) fn passenger_ids_for_packet( entity: &dyn Entity, ) -> Vec<i32>
pub(in player) fn send_mob_effect_sync_packet( &self, packet: MobEffectSyncPacket, )
fn send_active_effects_for_self(&self)
pub(in player) fn send_active_effects_for_vehicle( &self, vehicle: &dyn Entity, )
pub(crate) fn send_restored_vehicle_mount_sync(&self, vehicle: &dyn Entity)
pub(in player) fn remove_active_effects_for_vehicle( &self, vehicle: &dyn Entity, )
Source§impl Player
impl Player
fn apply_post_teleport_transition( &self, post_transition: &TeleportPostTransition, )
Sourcepub(crate) fn change_world_within_domain(
self: &Arc<Self>,
teleport_transition: &TeleportTransition,
) -> bool
pub(crate) fn change_world_within_domain( self: &Arc<Self>, teleport_transition: &TeleportTransition, ) -> bool
Applies an ordinary player transition that has already passed server world-change checks. Cross-domain player state is restored only by the domain-switch workflow.
Source§impl Player
impl Player
Sourcepub(crate) fn set_world(&self, world: Arc<World>)
pub(crate) fn set_world(&self, world: Arc<World>)
Sets the world the player is in.
This is used when the correct world isn’t known at construction time (e.g., when loading saved player data determines the actual world).
Sourcepub(crate) fn begin_domain_switch(&self, token: PendingWorldChangeToken) -> bool
pub(crate) fn begin_domain_switch(&self, token: PendingWorldChangeToken) -> bool
Marks the player as switching domains if they are not already in a transition.
Sourcepub(crate) fn is_domain_switch_queued(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn is_domain_switch_queued( &self, token: PendingWorldChangeToken, ) -> bool
Returns whether the queued domain switch still owns this token.
Sourcepub(crate) fn is_domain_switch_detached(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn is_domain_switch_detached( &self, token: PendingWorldChangeToken, ) -> bool
Returns whether the detached domain switch still owns this token.
Sourcepub(crate) fn mark_domain_switch_detached(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn mark_domain_switch_detached( &self, token: PendingWorldChangeToken, ) -> bool
Marks the token-owned domain switch as detached from its source world.
Sourcepub(crate) fn mark_domain_switch_target_handshake(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn mark_domain_switch_target_handshake( &self, token: PendingWorldChangeToken, ) -> bool
Opens only target-world acknowledgement packets before target insertion completes.
Sourcepub(crate) fn mark_domain_switch_live(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn mark_domain_switch_live( &self, token: PendingWorldChangeToken, ) -> bool
Marks the token-owned domain switch as live in its target world.
Sourcepub(crate) fn finish_domain_switch(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn finish_domain_switch( &self, token: PendingWorldChangeToken, ) -> bool
Clears a domain switch only if the caller still owns it.
Sourcepub(crate) fn begin_respawn_transition(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn begin_respawn_transition( &self, token: PendingWorldChangeToken, ) -> bool
Marks a token as owning respawn preparation if no player transition is active.
Sourcepub(crate) fn is_respawn_transition_pending(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn is_respawn_transition_pending( &self, token: PendingWorldChangeToken, ) -> bool
Returns whether respawn preparation still owns this token.
Sourcepub(crate) fn finish_respawn_transition(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn finish_respawn_transition( &self, token: PendingWorldChangeToken, ) -> bool
Clears respawn preparation only if the caller still owns it.
Sourcepub(crate) fn finish_player_transition(
&self,
token: PendingWorldChangeToken,
) -> bool
pub(crate) fn finish_player_transition( &self, token: PendingWorldChangeToken, ) -> bool
Clears either player transition kind only if the caller owns its token.
pub(crate) fn defer_death_respawn(&self)
pub(crate) fn retry_deferred_death_respawn(&self)
Sourcepub fn is_domain_switching(&self) -> bool
pub fn is_domain_switching(&self) -> bool
Returns whether this player is currently switching domains.
Sourcepub(crate) fn domain_switch_blocks_gameplay(&self) -> bool
pub(crate) fn domain_switch_blocks_gameplay(&self) -> bool
Returns whether the current domain-switch phase blocks gameplay work.
Sourcepub(crate) fn gate_domain_switch_packet(
&self,
handshake_packet: bool,
perform_respawn: bool,
) -> bool
pub(crate) fn gate_domain_switch_packet( &self, handshake_packet: bool, perform_respawn: bool, ) -> bool
Gates a packet against the current domain phase.
A dead player’s one-shot respawn request is retained while a queued or detached switch blocks normal gameplay packets.
Sourcepub fn has_joined_world(&self) -> bool
pub fn has_joined_world(&self) -> bool
Returns whether the server has inserted this player into a world.
Sourcepub(crate) fn mark_joined_world(&self) -> bool
pub(crate) fn mark_joined_world(&self) -> bool
Marks this player as inserted into a world.
Returns true when a client-loaded acknowledgement arrived before world
admission and was applied by this call.
Sourcepub fn has_client_loaded(&self) -> bool
pub fn has_client_loaded(&self) -> bool
Returns whether the client has sent its play-loaded signal.
Sourcepub fn set_client_loaded(&self, client_loaded: bool)
pub fn set_client_loaded(&self, client_loaded: bool)
Marks whether the client has loaded into play.
Sourcepub fn mark_client_loaded_from_network(&self) -> bool
pub fn mark_client_loaded_from_network(&self) -> bool
Applies or buffers the client’s play-loaded acknowledgement.
Returns true when the acknowledgement can run gameplay side effects now.
pub(super) fn tick_client_load_timeout(&self)
Source§impl Player
impl Player
const fn is_invalid_position( x: f64, y: f64, z: f64, rot_x: f32, rot_y: f32, ) -> bool
fn move_vehicle_packet_from_entity(entity: &dyn Entity) -> CMoveVehicle
Sourcefn update_awaiting_teleport(&self) -> bool
fn update_awaiting_teleport(&self) -> bool
Checks if we’re awaiting a teleport confirmation and handles timeout/resend.
Returns true if awaiting teleport (movement should be rejected),
false if normal movement processing should continue.
Sourcepub fn apply_post_impulse_grace_time(&self, ticks: i32)
pub fn apply_post_impulse_grace_time(&self, ticks: i32)
Applies vanilla post-impulse movement validation grace.
Sourcepub(super) fn reset_vehicle_movement_for_tick(&self)
pub(super) fn reset_vehicle_movement_for_tick(&self)
Resets per-tick vanilla movement validation bases for the controlled root vehicle.
Sourcefn should_validate_movement(world: &World, is_fall_flying: bool) -> bool
fn should_validate_movement(world: &World, is_fall_flying: bool) -> bool
Checks if movement validation should be performed for this player.
Matches vanilla’s ServerGamePacketListenerImpl.shouldValidateMovement().
Uses the playerMovementCheck and elytraMovementCheck gamerules.
Returns true if movement should be validated, false to skip validation.
Sourcepub fn handle_move_player(&self, packet: SMovePlayer)
pub fn handle_move_player(&self, packet: SMovePlayer)
Handles a move player packet.
Matches vanilla ServerGamePacketListenerImpl.handleMovePlayer().
§Panics
Panics if the server cannot restore the player to the last accepted position after rejecting invalid movement. That indicates world entity state refused an authoritative correction.
Sourcepub fn handle_move_vehicle(&self, packet: SMoveVehicle)
pub fn handle_move_vehicle(&self, packet: SMoveVehicle)
Handles a controlled-vehicle movement packet.
Matches vanilla ServerGamePacketListenerImpl.handleMoveVehicle().
fn record_client_floating( &self, world: &World, y_dist: f64, player_stands_on_something: bool, is_spectator: bool, is_fall_flying: bool, )
fn record_client_vehicle_floating( &self, world: &World, vehicle: &dyn Entity, y_dist: f64, vehicle_rests_on_something: bool, )
fn no_blocks_around_entity(world: &World, entity: &dyn Entity) -> bool
Sourcepub(super) fn maximum_flying_ticks(&self) -> i32
pub(super) fn maximum_flying_ticks(&self) -> i32
Returns how long vanilla permits unsupported floating for this player’s gravity.
Sourcefn maximum_flying_ticks_for_gravity(gravity: f64) -> i32
fn maximum_flying_ticks_for_gravity(gravity: f64) -> i32
Returns how long vanilla permits unsupported floating for an entity gravity value.
Sourcepub(super) fn disconnect_if_floating_too_long(&self) -> bool
pub(super) fn disconnect_if_floating_too_long(&self) -> bool
Advances vanilla’s floating violation tracker and disconnects when exceeded.
Sourcepub(super) fn disconnect_if_vehicle_floating_too_long(&self) -> bool
pub(super) fn disconnect_if_vehicle_floating_too_long(&self) -> bool
Advances vanilla’s controlled-vehicle floating tracker and disconnects when exceeded.
Sourcepub fn is_awaiting_teleport(&self) -> bool
pub fn is_awaiting_teleport(&self) -> bool
Returns true if we’re waiting for a teleport confirmation.
Sourcepub fn teleport(
&self,
pos: DVec3,
yaw: f32,
pitch: f32,
) -> Result<(), EntityMoveError>
pub fn teleport( &self, pos: DVec3, yaw: f32, pitch: f32, ) -> Result<(), EntityMoveError>
Teleports the player to a new position.
Sends a CPlayerPosition packet and waits for client acknowledgment.
Until acknowledged, movement packets from the client will be rejected.
Matches vanilla ServerGamePacketListenerImpl.teleport().
Sourcepub(crate) fn teleport_with_velocity(
&self,
pos: DVec3,
velocity: DVec3,
yaw: f32,
pitch: f32,
) -> Result<(), EntityMoveError>
pub(crate) fn teleport_with_velocity( &self, pos: DVec3, velocity: DVec3, yaw: f32, pitch: f32, ) -> Result<(), EntityMoveError>
Sends a CPlayerPosition packet with explicit delta movement for vanilla
ServerPlayer.teleport(TeleportTransition) paths.
Sourcepub(crate) fn teleport_with_velocity_packet(
&self,
pos: DVec3,
velocity: DVec3,
rotation: (f32, f32),
packet_pos: DVec3,
packet_velocity: DVec3,
packet_rotation: (f32, f32),
relatives: RelativeMovement,
) -> Result<(), EntityMoveError>
pub(crate) fn teleport_with_velocity_packet( &self, pos: DVec3, velocity: DVec3, rotation: (f32, f32), packet_pos: DVec3, packet_velocity: DVec3, packet_rotation: (f32, f32), relatives: RelativeMovement, ) -> Result<(), EntityMoveError>
Commits resolved server state while sending vanilla packet-relative values.
Sourcepub(crate) fn reset_flying_ticks(&self)
pub(crate) fn reset_flying_ticks(&self)
Resets vanilla floating violation counters after a successful high-level teleport.
Sourcepub fn handle_accept_teleportation(&self, packet: SAcceptTeleportation)
pub fn handle_accept_teleportation(&self, packet: SAcceptTeleportation)
Handles a teleport acknowledgment from the client.
Matches vanilla ServerGamePacketListenerImpl.handleAcceptTeleportPacket().
Sourcepub fn last_client_input(&self) -> PlayerInput
pub fn last_client_input(&self) -> PlayerInput
Returns the latest vanilla client input snapshot.
Sourcepub fn handle_player_input(&self, packet: SPlayerInput)
pub fn handle_player_input(&self, packet: SPlayerInput)
Handles a player input packet (movement keys, sneaking, sprinting).
Sourcepub fn handle_player_command(&self, packet: SPlayerCommand)
pub fn handle_player_command(&self, packet: SPlayerCommand)
Handles a player command packet (sprinting, elytra, leaving bed, etc).
Source§impl Player
impl Player
Sourcepub fn set_permission_state(
&self,
groups: Vec<String>,
overrides: PermissionSet,
metadata_overrides: PermissionMetadataSet,
effective: PermissionSet,
effective_metadata: PermissionMetadataSet,
) -> u64
pub fn set_permission_state( &self, groups: Vec<String>, overrides: PermissionSet, metadata_overrides: PermissionMetadataSet, effective: PermissionSet, effective_metadata: PermissionMetadataSet, ) -> u64
Replaces assigned groups, direct overrides, metadata, and effective state.
Sourcepub fn permissions(&self) -> PermissionSet
pub fn permissions(&self) -> PermissionSet
Returns a snapshot of effective permissions.
Sourcepub fn permission_groups(&self) -> Vec<String>
pub fn permission_groups(&self) -> Vec<String>
Returns assigned permission groups.
Sourcepub(crate) fn is_operator(&self) -> bool
pub(crate) fn is_operator(&self) -> bool
Returns whether the latest published subject state assigns the operator group.
Sourcepub fn permission_overrides(&self) -> PermissionSet
pub fn permission_overrides(&self) -> PermissionSet
Returns direct permission overrides.
Sourcepub fn permission_metadata_overrides(&self) -> PermissionMetadataSet
pub fn permission_metadata_overrides(&self) -> PermissionMetadataSet
Returns direct permission metadata overrides.
Sourcepub fn permission_state_version(&self) -> u64
pub fn permission_state_version(&self) -> u64
Returns the current permission snapshot version.
Sourcepub fn has_permission(&self, permission: &PermissionExpr) -> bool
pub fn has_permission(&self, permission: &PermissionExpr) -> bool
Returns whether the player satisfies an expression in their current world.
Sourcepub fn has_permission_in(
&self,
permission: &PermissionExpr,
context: &PermissionContext,
) -> bool
pub fn has_permission_in( &self, permission: &PermissionExpr, context: &PermissionContext, ) -> bool
Returns whether the player satisfies an expression in an explicit context.
Sourcepub fn permission_state(
&self,
permission: &PermissionExpr,
) -> Option<PermissionState>
pub fn permission_state( &self, permission: &PermissionExpr, ) -> Option<PermissionState>
Resolves an expression in the player’s current world.
Sourcepub fn permission_state_in(
&self,
permission: &PermissionExpr,
context: &PermissionContext,
) -> Option<PermissionState>
pub fn permission_state_in( &self, permission: &PermissionExpr, context: &PermissionContext, ) -> Option<PermissionState>
Resolves an expression in an explicit context.
Sourcepub fn permission_metadata(
&self,
key: &Identifier,
) -> Option<PermissionMetadataValue>
pub fn permission_metadata( &self, key: &Identifier, ) -> Option<PermissionMetadataValue>
Resolves one permission metadata value in the player’s current world.
Sourcepub fn permission_metadata_in(
&self,
key: &Identifier,
context: &PermissionContext,
) -> Option<PermissionMetadataValue>
pub fn permission_metadata_in( &self, key: &Identifier, context: &PermissionContext, ) -> Option<PermissionMetadataValue>
Resolves one permission metadata value in an explicit context.
Source§impl Player
impl Player
Sourcepub(crate) fn reset_domain_data_for_first_visit(&self)
pub(crate) fn reset_domain_data_for_first_visit(&self)
Resets domain-scoped gameplay data to the defaults used for a new player.
Source§impl Player
impl Player
Sourcepub(in player) fn touch_nearby_items(
&self,
)
pub(in player) fn touch_nearby_items( &self, )
Attempts to pick up nearby item entities.
Mirrors vanilla’s Player.aiStep() item pickup logic:
- Calculates pickup area as bounding box inflated by (1.0, 0.5, 1.0)
- Calls
playerTouch()on each entity in range
Handles a container button click packet (e.g., enchanting table buttons).
Sourcepub fn handle_container_click(&self, packet: SContainerClick)
pub fn handle_container_click(&self, packet: SContainerClick)
Handles a container click packet (slot interaction).
Sourcefn process_container_click(&self, menu: &mut Menu, packet: SContainerClick)
fn process_container_click(&self, menu: &mut Menu, packet: SContainerClick)
Processes a container click on any menu implementing the Menu trait.
This is the common implementation shared between inventory menu and external menus (crafting table, chest, etc.).
Sourcepub fn handle_container_close(&self, packet: SContainerClose)
pub fn handle_container_close(&self, packet: SContainerClose)
Handles a container close packet.
Based on Java’s ServerGamePacketListenerImpl::handleContainerClose.
Sourcepub fn handle_rename_item(self: &Arc<Self>, packet: SRenameItem)
pub fn handle_rename_item(self: &Arc<Self>, packet: SRenameItem)
Handles an anvil rename packet.
Sourcepub fn handle_container_slot_state_changed(
&self,
packet: SContainerSlotStateChanged,
)
pub fn handle_container_slot_state_changed( &self, packet: SContainerSlotStateChanged, )
Handles a container slot state changed packet (e.g., crafter slot toggle).
Sourcepub fn handle_set_creative_mode_slot(&self, packet: SSetCreativeModeSlot)
pub fn handle_set_creative_mode_slot(&self, packet: SSetCreativeModeSlot)
Handles a creative mode slot set packet.
Sourcepub fn handle_set_carried_item(&self, packet: SSetCarriedItem)
pub fn handle_set_carried_item(&self, packet: SSetCarriedItem)
Sets selected slot
Sourcepub fn send_inventory_to_remote(&self)
pub fn send_inventory_to_remote(&self)
Sends all inventory slots to the client (full sync). This should be called when the player first joins.
Sourcefn next_container_counter(&self) -> u8
fn next_container_counter(&self) -> u8
Generates the next container ID (1-100, wrapping around).
Based on Java’s ServerPlayer::nextContainerCounter.
Opens a menu for this player.
Based on Java’s ServerPlayer::openMenu.
§Arguments
title- The display title shown in the open-screen packet.create- Factory invoked with the allocated container id, player, and current world. If called by a menu hook, the factory runs after that hook releases its container locks.
§Panics
Panics if the created menu uses a different container id than the one
allocated for it, or has no menu type (i.e. the player’s own inventory
menu, which must never be opened via open_menu).
Sourcepub fn crafting_container(&self) -> Shared<CraftingContainer>
pub fn crafting_container(&self) -> Shared<CraftingContainer>
A shared handle to the 2x2 crafting grid of the always-open inventory menu.
Sourcepub(crate) fn inventory_crafting_handler(&self) -> CraftingHandler
pub(crate) fn inventory_crafting_handler(&self) -> CraftingHandler
A shared handler for the 2x2 crafting grid of the always-open inventory menu and its result.
Sourcepub fn close_container(&self)
pub fn close_container(&self)
Closes the currently open container and returns to the inventory menu.
Based on Java’s ServerPlayer::closeContainer.
This sends a close packet to the client.
Sourcepub fn do_close_container(&self)
pub fn do_close_container(&self)
Internal close container logic without sending a packet.
Based on Java’s ServerPlayer::doCloseContainer.
Called when the client sends a close packet or when opening a new menu.
Removes both the base inventory menu and any external menu.
This mirrors Player::remove: base crafting and carried items are
handled before the external menu, and menu hooks cannot install a
replacement while removal is in progress. The inventory menu remains
reusable because Steel keeps one Player across world changes.
Sourcepub fn has_container_open(&self) -> bool
pub fn has_container_open(&self) -> bool
Returns true if the player has an external menu open (not the inventory).
Runs the open menu’s per-tick hook, if an external menu is open.
Scoped to the opened menu; the base inventory menu is not ticked. Called once per player tick, before syncing inventory changes to the client.
Sourcepub fn broadcast_inventory_changes(&self)
pub fn broadcast_inventory_changes(&self)
Broadcasts inventory changes to the client (incremental sync). This is called every tick to sync only changed slots.
Sourcepub(crate) fn request_inventory_resync(
&self,
slots: impl IntoIterator<Item = usize>,
)
pub(crate) fn request_inventory_resync( &self, slots: impl IntoIterator<Item = usize>, )
Requests direct synchronization of logical player-inventory slots.
Sourcepub(in player) fn flush_inventory_resync(
&self,
)
pub(in player) fn flush_inventory_resync( &self, )
Sends the latest values for requested logical inventory slots.
Sourcepub(crate) fn clear_or_count_matching_items(
&self,
predicate: &dyn Fn(&ItemStack) -> bool,
amount_to_remove: i32,
) -> i32
pub(crate) fn clear_or_count_matching_items( &self, predicate: &dyn Fn(&ItemStack) -> bool, amount_to_remove: i32, ) -> i32
Removes or counts matching stacks across every location used by vanilla /clear.
Sourcepub fn drop_from_selected(&self, all: bool)
pub fn drop_from_selected(&self, all: bool)
Drops an item from the player’s selected hotbar slot.
Based on Java’s ServerPlayer.drop(boolean all).
all: If true, drops the entire stack (Ctrl+Q). If false, drops one item (Q).
Sourcepub fn drop_item(
&self,
item: ItemStack,
throw_randomly: bool,
thrown_from_hand: bool,
) -> Option<Arc<ItemEntity>>
pub fn drop_item( &self, item: ItemStack, throw_randomly: bool, thrown_from_hand: bool, ) -> Option<Arc<ItemEntity>>
Drops an item into the world.
Based on Java’s LivingEntity.drop(ItemStack, boolean randomly, boolean thrownFromHand).
throw_randomly: If true, the item is thrown in a random direction. If false, it’s thrown in the direction the player is facing.thrown_from_hand: If true, sets the thrower and uses a longer pickup delay.
Sourcepub fn can_drop_items(&self) -> bool
pub fn can_drop_items(&self) -> bool
Returns true if the player can drop items.
Based on Java’s Player.canDropItems().
Returns false if the player is dead, removed, or has a flag preventing item drops.
Returns whether items from a closing menu (crafting grid, anvil inputs, cursor) should be placed back into the inventory instead of dropped into the world.
Matches vanilla’s AbstractContainerMenu.dropOrPlaceInInventory: a
disconnected player or one removed for any reason except a world change
drops the items.
Sourcepub fn add_item_or_drop(&self, item: ItemStack)
pub fn add_item_or_drop(&self, item: ItemStack)
Tries to add an item to the player’s inventory, dropping it if it doesn’t fit.
Based on Java’s Inventory.placeItemBackInInventory.
Sourcepub fn add_item_or_drop_with_guard(
&self,
guard: &mut ContainerLockGuard,
item: ItemStack,
)
pub fn add_item_or_drop_with_guard( &self, guard: &mut ContainerLockGuard, item: ItemStack, )
Tries to add an item to the player’s inventory using an existing lock guard, dropping it if it doesn’t fit.
Use this variant when you already hold a ContainerLockGuard that includes
the player’s inventory to avoid deadlocks.
Source§impl Player
impl Player
Sourcepub fn get_ray_endpoints(&self) -> (DVec3, DVec3)
pub fn get_ray_endpoints(&self) -> (DVec3, DVec3)
Computes the start (eye position) and end positions for a raytrace.
Sourcepub fn previous_game_mode(&self) -> Option<GameType>
pub fn previous_game_mode(&self) -> Option<GameType>
Returns the player’s previous game mode.
Sourcepub(crate) fn restore_game_modes(
&self,
current: GameType,
previous: Option<GameType>,
)
pub(crate) fn restore_game_modes( &self, current: GameType, previous: Option<GameType>, )
Restores current and previous game mode from persistent player data.
Sourcefn change_game_mode_state(&self, game_mode: GameType) -> bool
fn change_game_mode_state(&self, game_mode: GameType) -> bool
Changes the current game mode and records the old current mode as previous.
Sourcepub fn new(
gameprofile: GameProfile,
connection: Arc<PlayerConnection>,
world: Arc<World>,
server: Weak<Server>,
config: Arc<RuntimeConfig>,
entity_id: i32,
client_information: ClientInformation,
) -> Self
pub fn new( gameprofile: GameProfile, connection: Arc<PlayerConnection>, world: Arc<World>, server: Weak<Server>, config: Arc<RuntimeConfig>, entity_id: i32, client_information: ClientInformation, ) -> Self
Creates a new player.
Sourcepub fn tick(&self)
pub fn tick(&self)
Ticks the player.
§Panics
Panics if the player position cannot be restored after ai_step. Vanilla treats the
pre-tick position as authoritative here, so a rejection indicates corrupted entity state.
Sourcefn tick_death(&self)
fn tick_death(&self)
Ticks the death animation timer.
Vanilla: LivingEntity.tickDeath() (not overridden by ServerPlayer).
Sourcefn sync_entity_data(&self)
fn sync_entity_data(&self)
Immediately flushes dirty player entity data to tracking players and self.
fn update_dirty_mob_effect_entity_data(&self)
Sourcepub fn handle_custom_payload(&self, _packet: SCustomPayload)
pub fn handle_custom_payload(&self, _packet: SCustomPayload)
Handles a custom payload packet.
Sourcepub fn handle_client_tick_end(&self)
pub fn handle_client_tick_end(&self)
Handles the end of a client tick.
Sourcepub fn hurt(&self, world: &World, source: &DamageSource, amount: f32) -> bool
pub fn hurt(&self, world: &World, source: &DamageSource, amount: f32) -> bool
Main entry point for dealing damage. Returns true if damage was applied.
world is vanilla’s explicit ServerLevel argument and controls
difficulty scaling and damage gamerules.
fn disabled_damage_game_rule(source: &DamageSource) -> Option<GameRuleRef<bool>>
Sourcefn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
Applies vanilla player damage reductions and health loss.
Sourcefn die(&self, source: &DamageSource)
fn die(&self, source: &DamageSource)
Vanilla: ServerPlayer.die() (does NOT call super.die()).
Sourcepub(crate) fn domain_residence_token(&self) -> DomainResidenceToken
pub(crate) fn domain_residence_token(&self) -> DomainResidenceToken
Returns the identity of the player’s current continuous domain stay.
Sourcepub(crate) fn advance_domain_residence(&self) -> DomainResidenceToken
pub(crate) fn advance_domain_residence(&self) -> DomainResidenceToken
Starts a new continuous domain stay and invalidates old restore work.
Sourcepub(crate) fn is_domain_residence_current(
&self,
token: DomainResidenceToken,
) -> bool
pub(crate) fn is_domain_residence_current( &self, token: DomainResidenceToken, ) -> bool
Returns whether delayed work still belongs to the current domain stay.
Sourcepub(crate) fn install_pending_domain_restores(
&self,
token: DomainResidenceToken,
world: &World,
root_vehicle: Option<PersistentRootVehicle>,
ender_pearls: Vec<PersistentEnderPearl>,
) -> bool
pub(crate) fn install_pending_domain_restores( &self, token: DomainResidenceToken, world: &World, root_vehicle: Option<PersistentRootVehicle>, ender_pearls: Vec<PersistentEnderPearl>, ) -> bool
Installs both persisted restore payloads for a token-owned domain stay.
pub(crate) fn clear_pending_root_vehicle(&self)
pub(crate) fn pending_root_vehicle_for_current_world( &self, ) -> Option<PersistentRootVehicle>
pub(crate) fn take_matching_pending_root_vehicle( &self, token: DomainResidenceToken, world: &World, attach: [u8; 16], root_uuid: [u8; 16], ) -> Option<PersistentRootVehicle>
pub(crate) fn pending_ender_pearls(&self) -> Vec<PersistentEnderPearl>
pub(crate) fn remove_pending_ender_pearl(&self, uuid: Uuid)
pub(crate) fn discard_pending_ender_pearl( &self, token: DomainResidenceToken, uuid: Uuid, ) -> bool
pub(crate) fn take_matching_pending_ender_pearl( &self, token: DomainResidenceToken, world: &World, uuid: Uuid, ) -> Option<PersistentEnderPearl>
Sourcepub fn register_ender_pearl(&self, pearl: &SharedEntity)
pub fn register_ender_pearl(&self, pearl: &SharedEntity)
Registers a thrown ender pearl so it persists with this player and
re-spawns on login (vanilla ServerPlayer.registerEnderPearl).
Sourcepub fn deregister_ender_pearl(&self, uuid: Uuid)
pub fn deregister_ender_pearl(&self, uuid: Uuid)
Deregisters a thrown ender pearl once it hits, teleports, or is discarded
(vanilla ServerPlayer.deregisterEnderPearl).
Sourcepub fn ender_pearls(&self) -> Vec<SharedEntity> ⓘ
pub fn ender_pearls(&self) -> Vec<SharedEntity> ⓘ
Returns this player’s live, in-flight ender pearls, pruning dead entries.
Sourcepub(crate) fn save_command_nbt(&self, nbt: &mut NbtCompound)
pub(crate) fn save_command_nbt(&self, nbt: &mut NbtCompound)
Appends vanilla-shaped player state used by command NBT predicates.
Sourcepub fn store_ender_pearls_with_player(&self)
pub fn store_ender_pearls_with_player(&self)
Marks live ender pearls as stored with this player so chunk saves remove them from world storage and player data remains the sole owner.
Sourcepub fn tick_count(&self) -> i32
pub fn tick_count(&self) -> i32
Returns this player’s local server tick count.
Sourcepub(crate) fn take_xp_delay(&self) -> i32
pub(crate) fn take_xp_delay(&self) -> i32
Returns vanilla Player.takeXpDelay.
Sourcepub(crate) fn set_take_xp_delay(&self, delay: i32)
pub(crate) fn set_take_xp_delay(&self, delay: i32)
Sets vanilla Player.takeXpDelay.
fn primary_step_sound_block_pos(&self, affecting_pos: BlockPos) -> BlockPos
Trait Implementations§
Source§impl DowncastType for Player
impl DowncastType for Player
Source§const TYPE_KEY: DowncastTypeKey
const TYPE_KEY: DowncastTypeKey
Source§impl Entity for Player
impl Entity for Player
Source§fn base(&self) -> &EntityBase
fn base(&self) -> &EntityBase
Source§fn entity_type(&self) -> EntityTypeRef
fn entity_type(&self) -> EntityTypeRef
Source§fn scoreboard_name(&self) -> String
fn scoreboard_name(&self) -> String
Source§fn name(&self) -> TextComponent
fn name(&self) -> TextComponent
Source§fn display_name(&self) -> TextComponent
fn display_name(&self) -> TextComponent
Source§fn plain_text_name(&self) -> String
fn plain_text_name(&self) -> String
Source§fn look_at(&self, from_anchor: EntityAnchor, target: DVec3)
fn look_at(&self, from_anchor: EntityAnchor, target: DVec3)
Source§fn look_at_entity(
&self,
from_anchor: EntityAnchor,
target: &dyn Entity,
target_anchor: EntityAnchor,
)
fn look_at_entity( &self, from_anchor: EntityAnchor, target: &dyn Entity, target_anchor: EntityAnchor, )
Source§fn is_always_ticking(&self) -> bool
fn is_always_ticking(&self) -> bool
Source§fn update_swimming(&self)
fn update_swimming(&self)
Source§fn stop_riding(&self)
fn stop_riding(&self)
Source§fn start_riding(&self, entity_to_ride: &SharedEntity) -> bool
fn start_riding(&self, entity_to_ride: &SharedEntity) -> bool
entity_to_ride if vanilla boarding rules allow it. Read moreSource§fn broadcast_to_player(&self, player: &Player) -> bool
fn broadcast_to_player(&self, player: &Player) -> bool
Source§fn fall_sounds(&self) -> (SoundEventRef, SoundEventRef)
fn fall_sounds(&self) -> (SoundEventRef, SoundEventRef)
Source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
Source§fn forces_fall_flying_velocity_sync(&self) -> bool
fn forces_fall_flying_velocity_sync(&self) -> bool
ServerEntity should force velocity sync for fall flying.Source§fn blocks_building(&self) -> bool
fn blocks_building(&self) -> bool
Source§fn is_pickable(&self) -> bool
fn is_pickable(&self) -> bool
Source§fn is_pushable(&self) -> bool
fn is_pushable(&self) -> bool
Source§fn on_climbable(&self) -> bool
fn on_climbable(&self) -> bool
Source§fn is_spectator(&self) -> bool
fn is_spectator(&self) -> bool
Source§fn is_flying_player(&self) -> bool
fn is_flying_player(&self) -> bool
flying set.Source§fn fire_immune_ticks(&self) -> i32
fn fire_immune_ticks(&self) -> i32
Source§fn remaining_fire_ticks_cap(&self) -> Option<i32>
fn remaining_fire_ticks_cap(&self) -> Option<i32>
remainingFireTicks this entity can store.Source§fn get_default_gravity(&self) -> f64
fn get_default_gravity(&self) -> f64
Source§fn fire_ignite_extra_ticks(&self) -> i32
fn fire_ignite_extra_ticks(&self) -> i32
Source§fn can_freeze(&self) -> bool
fn can_freeze(&self) -> bool
Source§fn make_stuck_in_block(&self, state: BlockStateId, speed_multiplier: DVec3)
fn make_stuck_in_block(&self, state: BlockStateId, speed_multiplier: DVec3)
Source§fn can_be_hit_by_projectile(&self) -> bool
fn can_be_hit_by_projectile(&self) -> bool
Source§fn uses_client_movement_packets(&self) -> bool
fn uses_client_movement_packets(&self) -> bool
Source§fn can_simulate_movement(&self) -> bool
fn can_simulate_movement(&self) -> bool
Source§fn is_effective_ai(&self) -> bool
fn is_effective_ai(&self) -> bool
Source§fn known_movement(&self) -> DVec3
fn known_movement(&self) -> DVec3
Source§fn known_speed(&self) -> DVec3
fn known_speed(&self) -> DVec3
getKnownSpeed.Source§fn is_suppressing_bounce(&self) -> bool
fn is_suppressing_bounce(&self) -> bool
Source§fn cause_fall_damage(
&self,
fall_distance: f64,
damage_modifier: f32,
source: &DamageSource,
) -> bool
fn cause_fall_damage( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool
Source§fn synced_data(&self) -> Option<&dyn EntitySyncedData>
fn synced_data(&self) -> Option<&dyn EntitySyncedData>
Source§fn update_data_before_sync(&self)
fn update_data_before_sync(&self)
Source§fn max_up_step(&self) -> f32
fn max_up_step(&self) -> f32
Source§fn backs_off_from_edge(&self) -> bool
fn backs_off_from_edge(&self) -> bool
Source§fn is_pushed_by_fluid(&self) -> bool
fn is_pushed_by_fluid(&self) -> bool
Source§fn is_crouching(&self) -> bool
fn is_crouching(&self) -> bool
Source§fn may_interact(&self, world: &World, pos: BlockPos) -> bool
fn may_interact(&self, world: &World, pos: BlockPos) -> bool
Source§fn is_swimming(&self) -> bool
fn is_swimming(&self) -> bool
Source§fn sound_source(&self) -> SoundSource
fn sound_source(&self) -> SoundSource
Source§fn swim_sound(&self) -> SoundEventRef
fn swim_sound(&self) -> SoundEventRef
Source§fn play_step_sound(&self, on_pos: BlockPos, on_state: BlockStateId)
fn play_step_sound(&self, on_pos: BlockPos, on_state: BlockStateId)
Source§fn movement_emission(&self) -> EntityMovementEmission
fn movement_emission(&self) -> EntityMovementEmission
Source§fn on_below_world(&self)
fn on_below_world(&self)
Source§fn dimensions_for_pose(&self, pose: EntityPose) -> EntityDimensions
fn dimensions_for_pose(&self, pose: EntityPose) -> EntityDimensions
Source§fn hurt(&self, world: &World, source: &DamageSource, amount: f32) -> bool
fn hurt(&self, world: &World, source: &DamageSource, amount: f32) -> bool
Source§fn nbt_for_data_compare(&self) -> NbtCompound
fn nbt_for_data_compare(&self) -> NbtCompound
Source§fn nbt_for_passenger_save(&self) -> Option<NbtCompound>
fn nbt_for_passenger_save(&self) -> Option<NbtCompound>
Source§fn spawn_position(&self) -> DVec3
fn spawn_position(&self) -> DVec3
Source§fn block_position(&self) -> BlockPos
fn block_position(&self) -> BlockPos
Source§fn in_block_state(&self, world: &World) -> BlockStateId
fn in_block_state(&self, world: &World) -> BlockStateId
Entity.getInBlockState.Source§fn old_position(&self) -> DVec3
fn old_position(&self) -> DVec3
Source§fn bounding_box(&self) -> WorldAabb
fn bounding_box(&self) -> WorldAabb
Source§fn is_free(&self, delta: DVec3) -> bool
fn is_free(&self, delta: DVec3) -> bool
Entity.isFree() for the current bounding box shifted by delta.Source§fn attackable(&self) -> bool
fn attackable(&self) -> bool
Source§fn skip_attack_interaction(&self, _source: &dyn Entity) -> bool
fn skip_attack_interaction(&self, _source: &dyn Entity) -> bool
Source§fn on_above_bubble_column(&self, drag_down: bool, _pos: BlockPos)
fn on_above_bubble_column(&self, drag_down: bool, _pos: BlockPos)
Entity.onAboveBubbleColumn.Source§fn on_inside_bubble_column(&self, drag_down: bool)
fn on_inside_bubble_column(&self, drag_down: bool)
Entity.onInsideBubbleColumn.Source§fn is_ignoring_block_triggers(&self) -> bool
fn is_ignoring_block_triggers(&self) -> bool
Source§fn piston_push_reaction(&self) -> PushReaction
fn piston_push_reaction(&self) -> PushReaction
Source§fn is_supported_by(&self, pos: BlockPos) -> bool
fn is_supported_by(&self, pos: BlockPos) -> bool
pos.Source§fn can_interact_with_level(&self) -> bool
fn can_interact_with_level(&self) -> bool
Source§fn is_invisible(&self) -> bool
fn is_invisible(&self) -> bool
Entity.isInvisible().Source§fn is_discrete(&self) -> bool
fn is_discrete(&self) -> bool
Entity.isDiscrete().Source§fn is_allied_to(&self, _other: &dyn Entity) -> bool
fn is_allied_to(&self, _other: &dyn Entity) -> bool
other.Source§fn is_marker_armor_stand(&self) -> bool
fn is_marker_armor_stand(&self) -> bool
Source§fn is_tame_owned_by(&self, _owner: &dyn LivingEntity) -> bool
fn is_tame_owned_by(&self, _owner: &dyn LivingEntity) -> bool
owner.Source§fn projectile_owner_uuid(&self) -> Option<Uuid>
fn projectile_owner_uuid(&self) -> Option<Uuid>
Projectile owner UUID when this entity exposes one.Source§fn projectile_owner(&self) -> Option<SharedEntity>
fn projectile_owner(&self) -> Option<SharedEntity>
Projectile owner when this entity exposes one.Source§fn can_be_collided_with(&self, _other: Option<&dyn Entity>) -> bool
fn can_be_collided_with(&self, _other: Option<&dyn Entity>) -> bool
other can collide with this entity. Read moreSource§fn deflection(&self, _projectile: &dyn Projectile) -> ProjectileDeflection
fn deflection(&self, _projectile: &dyn Projectile) -> ProjectileDeflection
Source§fn vehicle(&self) -> Option<SharedEntity>
fn vehicle(&self) -> Option<SharedEntity>
Source§fn controlled_vehicle(&self) -> Option<SharedEntity>
fn controlled_vehicle(&self) -> Option<SharedEntity>
Source§fn is_passenger(&self) -> bool
fn is_passenger(&self) -> bool
Source§fn can_ride(&self, _vehicle: &dyn Entity) -> bool
fn can_ride(&self, _vehicle: &dyn Entity) -> bool
vehicle. Read moreSource§fn passengers(&self) -> Vec<SharedEntity> ⓘ
fn passengers(&self) -> Vec<SharedEntity> ⓘ
Source§fn count_player_passengers(&self) -> usize
fn count_player_passengers(&self) -> usize
Source§fn has_exactly_one_player_passenger(&self) -> bool
fn has_exactly_one_player_passenger(&self) -> bool
Source§fn first_passenger(&self) -> Option<SharedEntity>
fn first_passenger(&self) -> Option<SharedEntity>
Source§fn controlling_passenger(&self) -> Option<SharedEntity>
fn controlling_passenger(&self) -> Option<SharedEntity>
Source§fn can_control_vehicle(&self) -> bool
fn can_control_vehicle(&self) -> bool
Source§fn has_controlling_passenger(&self) -> bool
fn has_controlling_passenger(&self) -> bool
Source§fn is_vehicle(&self) -> bool
fn is_vehicle(&self) -> bool
Source§fn dismounts_underwater(&self) -> bool
fn dismounts_underwater(&self) -> bool
Entity.dismountsUnderwater.Source§fn has_passenger(&self, passenger: &dyn Entity) -> bool
fn has_passenger(&self, passenger: &dyn Entity) -> bool
passenger is a direct passenger of this entity. Read moreSource§fn can_add_passenger(&self, _passenger: &dyn Entity) -> bool
fn can_add_passenger(&self, _passenger: &dyn Entity) -> bool
passenger as a direct passenger. Read moreSource§fn could_accept_passenger(&self) -> bool
fn could_accept_passenger(&self) -> bool
Source§fn passenger_index(&self, passenger: &dyn Entity) -> Option<usize>
fn passenger_index(&self, passenger: &dyn Entity) -> Option<usize>
Source§fn vehicle_attachment_point(&self, _vehicle: &dyn Entity) -> DVec3
fn vehicle_attachment_point(&self, _vehicle: &dyn Entity) -> DVec3
Source§fn passenger_attachment_point(&self, passenger: &dyn Entity) -> DVec3
fn passenger_attachment_point(&self, passenger: &dyn Entity) -> DVec3
Source§fn passenger_riding_position(&self, passenger: &dyn Entity) -> DVec3
fn passenger_riding_position(&self, passenger: &dyn Entity) -> DVec3
passenger should ride this vehicle. Read moreSource§fn position_rider(&self, passenger: &dyn Entity)
fn position_rider(&self, passenger: &dyn Entity)
Source§fn root_vehicle_id(&self) -> i32
fn root_vehicle_id(&self) -> i32
Source§fn root_vehicle(&self) -> Option<SharedEntity>
fn root_vehicle(&self) -> Option<SharedEntity>
Source§fn is_passenger_of_same_vehicle(&self, other: &dyn Entity) -> bool
fn is_passenger_of_same_vehicle(&self, other: &dyn Entity) -> bool
other share the same root vehicle. Read moreSource§fn has_indirect_passenger(&self, entity: &dyn Entity) -> bool
fn has_indirect_passenger(&self, entity: &dyn Entity) -> bool
entity is an indirect passenger of this entity. Read moreSource§fn can_collide_with(&self, other: &dyn Entity) -> bool
fn can_collide_with(&self, other: &dyn Entity) -> bool
other. Read moreSource§fn push_impulse(&self, impulse: DVec3)
fn push_impulse(&self, impulse: DVec3)
Source§fn push_entity(&self, entity: &dyn Entity)
fn push_entity(&self, entity: &dyn Entity)
Source§fn make_bounding_box_at(&self, position: DVec3) -> WorldAabb
fn make_bounding_box_at(&self, position: DVec3) -> WorldAabb
position.Source§fn get_relative_portal_position(
&self,
axis: Axis,
portal_area: FoundRectangle,
) -> DVec3
fn get_relative_portal_position( &self, axis: Axis, portal_area: FoundRectangle, ) -> DVec3
Entity.getRelativePortalPosition.Source§fn default_tick(&self)
fn default_tick(&self)
Entity.tick() behavior. Read moreSource§fn ride_tick(&self)
fn ride_tick(&self)
Source§fn handle_portal(&self)
fn handle_portal(&self)
Entity.handlePortal behavior currently implemented by Steel.Source§fn entity_base_tick(&self)
fn entity_base_tick(&self)
Entity.baseTick behavior. Read moreSource§fn check_below_world(&self)
fn check_below_world(&self)
Source§fn check_despawn(&self)
fn check_despawn(&self)
Source§fn apply_inside_block_effect(&self, effect_type: InsideBlockEffectType)
fn apply_inside_block_effect(&self, effect_type: InsideBlockEffectType)
Source§fn pack_dirty_entity_data(&self) -> Option<Vec<DataValue>>
fn pack_dirty_entity_data(&self) -> Option<Vec<DataValue>>
Source§fn pack_all_entity_data(&self) -> Vec<DataValue>
fn pack_all_entity_data(&self) -> Vec<DataValue>
Source§fn is_removed(&self) -> bool
fn is_removed(&self) -> bool
Source§fn begin_pending_world_change(&self) -> Option<PendingWorldChangeToken>
fn begin_pending_world_change(&self) -> Option<PendingWorldChangeToken>
Source§fn finish_pending_world_change(&self, token: PendingWorldChangeToken) -> bool
fn finish_pending_world_change(&self, token: PendingWorldChangeToken) -> bool
Source§fn is_world_change_pending(&self) -> bool
fn is_world_change_pending(&self) -> bool
Source§fn is_world_change_token_pending(&self, token: PendingWorldChangeToken) -> bool
fn is_world_change_token_pending(&self, token: PendingWorldChangeToken) -> bool
Source§fn can_use_portal(&self, ignore_passenger: bool) -> bool
fn can_use_portal(&self, ignore_passenger: bool) -> bool
Source§fn dimension_changing_delay(&self) -> i32
fn dimension_changing_delay(&self) -> i32
Source§fn removal_reason(&self) -> Option<RemovalReason>
fn removal_reason(&self) -> Option<RemovalReason>
Source§fn set_removed(&self, reason: RemovalReason)
fn set_removed(&self, reason: RemovalReason)
Source§fn game_event(&self, event: GameEventRef)
fn game_event(&self, event: GameEventRef)
Source§fn kill(&self, world: &World)
fn kill(&self, world: &World)
Source§fn restore_owner_reference(&self, _owner: &SharedEntity)
fn restore_owner_reference(&self, _owner: &SharedEntity)
Source§fn set_level_callback(&self, callback: Arc<dyn EntityLevelCallback>)
fn set_level_callback(&self, callback: Arc<dyn EntityLevelCallback>)
Source§fn notify_leash_holder(&self, _leashable: &dyn Entity)
fn notify_leash_holder(&self, _leashable: &dyn Entity)
Source§fn notify_leashee_removed(&self, _leashable: &dyn Entity)
fn notify_leashee_removed(&self, _leashable: &dyn Entity)
Source§fn player_touch(self: Arc<Self>, _player: &Arc<Player>)
fn player_touch(self: Arc<Self>, _player: &Arc<Player>)
Source§fn leashables_leashed_to(&self) -> Vec<SharedEntity> ⓘ
fn leashables_leashed_to(&self) -> Vec<SharedEntity> ⓘ
Source§fn leashables_leashed_to_holder_in_area(
&self,
holder: &dyn Entity,
) -> Vec<SharedEntity> ⓘ
fn leashables_leashed_to_holder_in_area( &self, holder: &dyn Entity, ) -> Vec<SharedEntity> ⓘ
holder.Source§fn transfer_leashables_from_holder(&self, old_holder: &dyn Entity) -> bool
fn transfer_leashables_from_holder(&self, old_holder: &dyn Entity) -> bool
old_holder to this entity.Source§fn drop_all_leash_connections(&self, player: Option<&Player>) -> bool
fn drop_all_leash_connections(&self, player: Option<&Player>) -> bool
Source§fn shear_off_all_leash_connections(&self, player: Option<&Player>) -> bool
fn shear_off_all_leash_connections(&self, player: Option<&Player>) -> bool
Source§fn attempt_to_shear_equipment(
&self,
player: &Player,
hand: InteractionHand,
) -> bool
fn attempt_to_shear_equipment( &self, player: &Player, hand: InteractionHand, ) -> bool
Entity.attemptToShearEquipment.Source§fn interact(
&self,
player: &Player,
hand: InteractionHand,
location: DVec3,
) -> InteractionResult
fn interact( &self, player: &Player, hand: InteractionHand, location: DVec3, ) -> InteractionResult
Source§fn interact_entity(
&self,
player: &Player,
hand: InteractionHand,
_location: DVec3,
) -> InteractionResult
fn interact_entity( &self, player: &Player, hand: InteractionHand, _location: DVec3, ) -> InteractionResult
Entity.interact behavior.Source§fn is_living_entity(&self) -> bool
fn is_living_entity(&self) -> bool
Source§fn is_abstract_arrow(&self) -> bool
fn is_abstract_arrow(&self) -> bool
AbstractArrow hierarchy.Source§fn as_projectile(&self) -> Option<&dyn Projectile>
fn as_projectile(&self) -> Option<&dyn Projectile>
Source§fn as_living_entity(&self) -> Option<&dyn LivingEntity>
fn as_living_entity(&self) -> Option<&dyn LivingEntity>
Source§fn as_item_frame(&self) -> Option<&dyn ItemFrame>
fn as_item_frame(&self) -> Option<&dyn ItemFrame>
Source§fn as_player(&self) -> Option<&Player>
fn as_player(&self) -> Option<&Player>
Source§fn with_weapon_item(&self, visitor: &mut dyn FnMut(Option<&ItemStack>))
fn with_weapon_item(&self, visitor: &mut dyn FnMut(Option<&ItemStack>))
Entity.getWeaponItem without copying inventory state.Source§fn is_pathfinder_mob(&self) -> bool
fn is_pathfinder_mob(&self) -> bool
Source§fn as_pathfinder_mob(&self) -> Option<&dyn PathfinderMob>
fn as_pathfinder_mob(&self) -> Option<&dyn PathfinderMob>
Source§fn as_mob(&self) -> Option<&dyn Mob>
fn as_mob(&self) -> Option<&dyn Mob>
Source§fn as_animal(&self) -> Option<&dyn Animal>
fn as_animal(&self) -> Option<&dyn Animal>
Source§fn is_ageable_mob(&self) -> bool
fn is_ageable_mob(&self) -> bool
Source§fn as_ageable_mob(&self) -> Option<&dyn AgeableMob>
fn as_ageable_mob(&self) -> Option<&dyn AgeableMob>
Source§fn is_item_steerable(&self) -> bool
fn is_item_steerable(&self) -> bool
Source§fn as_item_steerable(&self) -> Option<&dyn ItemSteerable>
fn as_item_steerable(&self) -> Option<&dyn ItemSteerable>
Source§fn is_server_driven_movement(&self) -> bool
fn is_server_driven_movement(&self) -> bool
Source§fn is_stepping_carefully(&self) -> bool
fn is_stepping_carefully(&self) -> bool
Source§fn is_descending(&self) -> bool
fn is_descending(&self) -> bool
Source§fn default_update_swimming(&self)
fn default_update_swimming(&self)
Entity.updateSwimming for player overrides.Source§fn is_flying_vehicle(&self) -> bool
fn is_flying_vehicle(&self) -> bool
Source§fn tick_count(&self) -> i32
fn tick_count(&self) -> i32
Entity.tickCount.Source§fn advance_tick_count(&self)
fn advance_tick_count(&self)
Entity.tickCount.Source§fn rotation(&self) -> (f32, f32)
fn rotation(&self) -> (f32, f32)
Source§fn set_rotation(&self, rotation: (f32, f32))
fn set_rotation(&self, rotation: (f32, f32))
Source§fn direction_yaw(&self) -> Direction
fn direction_yaw(&self) -> Direction
Source§fn spawn_data(&self) -> i32
fn spawn_data(&self) -> i32
Source§fn get_eye_height(&self) -> f64
fn get_eye_height(&self) -> f64
Source§fn get_fluid_jump_threshold(&self) -> f64
fn get_fluid_jump_threshold(&self) -> f64
Entity.getFluidJumpThreshold().Source§fn is_in_wall(&self) -> bool
fn is_in_wall(&self) -> bool
Entity.isInWall.Source§fn calculate_view_vector(&self, pitch_degrees: f32, yaw_degrees: f32) -> DVec3
fn calculate_view_vector(&self, pitch_degrees: f32, yaw_degrees: f32) -> DVec3
Entity.calculateViewVector().Source§fn look_angle(&self) -> DVec3
fn look_angle(&self) -> DVec3
Entity.getLookAngle().Source§fn hand_holding_item_angle(&self, item: ItemRef) -> DVec3
fn hand_holding_item_angle(&self, item: ItemRef) -> DVec3
item. Read moreSource§fn set_velocity(&self, velocity: DVec3)
fn set_velocity(&self, velocity: DVec3)
Source§fn needs_velocity_sync(&self) -> bool
fn needs_velocity_sync(&self) -> bool
ServerEntity should consider sending velocity.Source§fn mark_velocity_sync(&self)
fn mark_velocity_sync(&self)
ServerEntity synchronization.Source§fn clear_velocity_sync(&self)
fn clear_velocity_sync(&self)
Source§fn hurt_marked(&self) -> bool
fn hurt_marked(&self) -> bool
Source§fn clear_hurt_mark(&self)
fn clear_hurt_mark(&self)
Source§fn fall_distance(&self) -> f64
fn fall_distance(&self) -> f64
Source§fn is_in_powder_snow(&self) -> bool
fn is_in_powder_snow(&self) -> bool
Source§fn was_in_powder_snow(&self) -> bool
fn was_in_powder_snow(&self) -> bool
Source§fn set_fall_distance(&self, fall_distance: f64)
fn set_fall_distance(&self, fall_distance: f64)
Source§fn reset_fall_distance(&self)
fn reset_fall_distance(&self)
Source§fn check_fall_distance_accumulation(&self)
fn check_fall_distance_accumulation(&self)
Entity.checkFallDistanceAccumulation().Source§fn fire_freeze_state(&self) -> EntityFireFreezeState
fn fire_freeze_state(&self) -> EntityFireFreezeState
Source§fn remaining_fire_ticks(&self) -> i32
fn remaining_fire_ticks(&self) -> i32
remainingFireTicks.Source§fn set_remaining_fire_ticks(&self, remaining_fire_ticks: i32)
fn set_remaining_fire_ticks(&self, remaining_fire_ticks: i32)
remainingFireTicks.Source§fn ticks_frozen(&self) -> i32
fn ticks_frozen(&self) -> i32
TicksFrozen.Source§fn set_ticks_frozen(&self, ticks_frozen: i32)
fn set_ticks_frozen(&self, ticks_frozen: i32)
TicksFrozen.Source§fn fire_immune(&self) -> bool
fn fire_immune(&self) -> bool
Source§fn should_play_lava_hurt_sound(&self) -> bool
fn should_play_lava_hurt_sound(&self) -> bool
Source§fn is_on_fire(&self) -> bool
fn is_on_fire(&self) -> bool
Source§fn has_visual_fire(&self) -> bool
fn has_visual_fire(&self) -> bool
hasVisualFire.Source§fn is_freezing(&self) -> bool
fn is_freezing(&self) -> bool
Source§fn default_can_freeze(&self) -> bool
fn default_can_freeze(&self) -> bool
Entity.canFreeze() without living-equipment overrides.Source§fn ticks_required_to_freeze(&self) -> i32
fn ticks_required_to_freeze(&self) -> i32
getTicksRequiredToFreeze.Source§fn is_fully_frozen(&self) -> bool
fn is_fully_frozen(&self) -> bool
Source§fn percent_frozen(&self) -> f32
fn percent_frozen(&self) -> f32
Entity.getPercentFrozen.Source§fn clear_freeze(&self)
fn clear_freeze(&self)
Source§fn clear_fire(&self)
fn clear_fire(&self)
Source§fn ignite_for_ticks(&self, number_of_ticks: i32)
fn ignite_for_ticks(&self, number_of_ticks: i32)
Source§fn sync_base_fire_freeze_entity_data(&self)
fn sync_base_fire_freeze_entity_data(&self)
Source§fn sync_base_entity_data(&self)
fn sync_base_entity_data(&self)
Source§fn is_in_water(&self) -> bool
fn is_in_water(&self) -> bool
Source§fn is_in_lava(&self) -> bool
fn is_in_lava(&self) -> bool
Source§fn is_eye_in_water(&self) -> bool
fn is_eye_in_water(&self) -> bool
Source§fn is_eye_in_lava(&self) -> bool
fn is_eye_in_lava(&self) -> bool
Source§fn is_under_water(&self) -> bool
fn is_under_water(&self) -> bool
Source§fn fluid_contact(&self) -> EntityFluidContact
fn fluid_contact(&self) -> EntityFluidContact
Source§fn refresh_fluid_contact(&self) -> EntityFluidContact
fn refresh_fluid_contact(&self) -> EntityFluidContact
Source§fn refresh_fluid_contact_for_base_tick(&self) -> EntityFluidContact
fn refresh_fluid_contact_for_base_tick(&self) -> EntityFluidContact
Source§fn scan_and_store_fluid_contact(
&self,
advance_eye_water_history: bool,
) -> EntityFluidContact
fn scan_and_store_fluid_contact( &self, advance_eye_water_history: bool, ) -> EntityFluidContact
Source§fn apply_fluid_current_for_base_tick(
&self,
world: &Arc<World>,
contact: EntityFluidContact,
)
fn apply_fluid_current_for_base_tick( &self, world: &Arc<World>, contact: EntityFluidContact, )
Source§fn apply_fluid_current_impulse(&self, impulse: DVec3)
fn apply_fluid_current_impulse(&self, impulse: DVec3)
Source§fn is_fall_damage_immune(&self) -> bool
fn is_fall_damage_immune(&self) -> bool
Source§fn propagate_fall_to_passengers(
&self,
fall_distance: f64,
damage_modifier: f32,
source: &DamageSource,
)
fn propagate_fall_to_passengers( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, )
Source§fn horizontal_collision(&self) -> bool
fn horizontal_collision(&self) -> bool
Source§fn vertical_collision(&self) -> bool
fn vertical_collision(&self) -> bool
Source§fn vertical_collision_below(&self) -> bool
fn vertical_collision_below(&self) -> bool
Source§fn no_physics(&self) -> bool
fn no_physics(&self) -> bool
Source§fn is_affected_by_blocks(&self) -> bool
fn is_affected_by_blocks(&self) -> bool
Source§fn set_no_physics(&self, no_physics: bool)
fn set_no_physics(&self, no_physics: bool)
Source§fn update_no_physics_from_current_collision(&self)
fn update_no_physics_from_current_collision(&self)
noPhysics from the entity’s current collision state.Source§fn move_towards_closest_space(&self, x: f64, y: f64, z: f64)
fn move_towards_closest_space(&self, x: f64, y: f64, z: f64)
Source§fn default_make_stuck_in_block(
&self,
_state: BlockStateId,
speed_multiplier: DVec3,
)
fn default_make_stuck_in_block( &self, _state: BlockStateId, speed_multiplier: DVec3, )
Source§fn apply_effects_from_blocks(&self)
fn apply_effects_from_blocks(&self)
Source§fn apply_effects_from_blocks_between(&self, from: DVec3, to: DVec3)
fn apply_effects_from_blocks_between(&self, from: DVec3, to: DVec3)
Source§fn apply_effects_from_blocks_for_last_movements(&self)
fn apply_effects_from_blocks_for_last_movements(&self)
Source§fn set_on_ground(&self, on_ground: bool)
fn set_on_ground(&self, on_ground: bool)
Source§fn set_on_ground_with_movement(
&self,
on_ground: bool,
horizontal_collision: bool,
movement: DVec3,
)
fn set_on_ground_with_movement( &self, on_ground: bool, horizontal_collision: bool, movement: DVec3, )
Source§fn default_apply_accepted_client_movement(
&self,
world: &Arc<World>,
accepted: AcceptedClientMovement,
) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
fn default_apply_accepted_client_movement( &self, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
Source§fn apply_accepted_client_movement(
&self,
world: &Arc<World>,
accepted: AcceptedClientMovement,
) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
fn apply_accepted_client_movement( &self, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
Source§fn apply_accepted_client_vehicle_movement(
&self,
world: &Arc<World>,
accepted: AcceptedClientMovement,
) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
fn apply_accepted_client_vehicle_movement( &self, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>
Source§fn try_set_position(&self, pos: DVec3) -> Result<(), EntityMoveError>
fn try_set_position(&self, pos: DVec3) -> Result<(), EntityMoveError>
Source§fn set_old_position_to_current(&self)
fn set_old_position_to_current(&self)
Source§fn set_old_position(&self, old_position: DVec3)
fn set_old_position(&self, old_position: DVec3)
Source§fn remove_latest_movement_recording(&self)
fn remove_latest_movement_recording(&self)
Source§fn on_pos(&self, offset: f32) -> Option<BlockPos>
fn on_pos(&self, offset: f32) -> Option<BlockPos>
Source§fn block_pos_below_that_affects_movement(&self) -> Option<BlockPos>
fn block_pos_below_that_affects_movement(&self) -> Option<BlockPos>
Source§fn on_pos_legacy(&self) -> Option<BlockPos>
fn on_pos_legacy(&self) -> Option<BlockPos>
getOnPosLegacy(), used by fall/step block hooks.Source§fn block_speed_factor(&self) -> f32
fn block_speed_factor(&self) -> f32
Source§fn block_jump_factor(&self) -> f32
fn block_jump_factor(&self) -> f32
Entity.getBlockJumpFactor().Source§fn refresh_dimensions(&self)
fn refresh_dimensions(&self)
Source§fn is_on_rails(&self) -> bool
fn is_on_rails(&self) -> bool
Source§fn is_state_climbable(&self, state: BlockStateId) -> bool
fn is_state_climbable(&self, state: BlockStateId) -> bool
Source§fn air_supply(&self) -> i32
fn air_supply(&self) -> i32
Air value.Source§fn set_air_supply(&self, air_supply: i32)
fn set_air_supply(&self, air_supply: i32)
Air value.Source§fn max_air_supply(&self) -> i32
fn max_air_supply(&self) -> i32
Source§fn portal_cooldown(&self) -> i32
fn portal_cooldown(&self) -> i32
Source§fn set_portal_cooldown(&self, portal_cooldown: i32)
fn set_portal_cooldown(&self, portal_cooldown: i32)
Source§fn is_on_portal_cooldown(&self) -> bool
fn is_on_portal_cooldown(&self) -> bool
Source§fn reset_portal_cooldown(&self)
fn reset_portal_cooldown(&self)
Source§fn set_as_inside_portal(&self, portal: PortalKind, entry_position: BlockPos)
fn set_as_inside_portal(&self, portal: PortalKind, entry_position: BlockPos)
Source§fn custom_name(&self) -> Option<TextComponent>
fn custom_name(&self) -> Option<TextComponent>
Source§fn set_custom_name(&self, custom_name: Option<TextComponent>)
fn set_custom_name(&self, custom_name: Option<TextComponent>)
Source§fn is_custom_name_visible(&self) -> bool
fn is_custom_name_visible(&self) -> bool
Source§fn set_custom_name_visible(&self, visible: bool)
fn set_custom_name_visible(&self, visible: bool)
Source§fn has_glowing_tag(&self) -> bool
fn has_glowing_tag(&self) -> bool
Source§fn set_glowing_tag(&self, glowing: bool)
fn set_glowing_tag(&self, glowing: bool)
Source§fn remove_tag(&self, tag: &str) -> bool
fn remove_tag(&self, tag: &str) -> bool
Source§fn custom_data(&self) -> NbtCompound
fn custom_data(&self) -> NbtCompound
Source§fn set_custom_data(&self, custom_data: NbtCompound)
fn set_custom_data(&self, custom_data: NbtCompound)
Source§fn set_silent(&self, silent: bool)
fn set_silent(&self, silent: bool)
Source§fn broadcast_entity_event(&self, event: EntityStatus)
fn broadcast_entity_event(&self, event: EntityStatus)
Source§fn play_sound(&self, sound: SoundEventRef, volume: f32, pitch: f32)
fn play_sound(&self, sound: SoundEventRef, volume: f32, pitch: f32)
Source§fn play_entity_on_fire_extinguished_sound(&self)
fn play_entity_on_fire_extinguished_sound(&self)
Source§fn play_block_step_sound(&self, block_state: BlockStateId)
fn play_block_step_sound(&self, block_state: BlockStateId)
Source§fn play_muffled_step_sound(&self, block_state: BlockStateId)
fn play_muffled_step_sound(&self, block_state: BlockStateId)
Source§fn play_combination_step_sounds(
&self,
primary_step_sound: BlockStateId,
secondary_step_sound: BlockStateId,
)
fn play_combination_step_sounds( &self, primary_step_sound: BlockStateId, secondary_step_sound: BlockStateId, )
Source§fn walking_step_sound(&self, pos: BlockPos, block_state: BlockStateId)
fn walking_step_sound(&self, pos: BlockPos, block_state: BlockStateId)
Source§fn play_amethyst_step_sound(&self)
fn play_amethyst_step_sound(&self)
Source§fn water_swim_sound(&self)
fn water_swim_sound(&self)
Source§fn play_swim_sound(&self, volume: f32)
fn play_swim_sound(&self, volume: f32)
Source§fn is_flapping(&self) -> bool
fn is_flapping(&self) -> bool
Source§fn process_flapping_movement(&self)
fn process_flapping_movement(&self)
Source§fn next_step(&self) -> f32
fn next_step(&self) -> f32
Source§fn apply_movement_emission_and_play_sound(
&self,
emission: EntityMovementEmission,
clipped_movement: DVec3,
effect_pos: BlockPos,
effect_state: BlockStateId,
)
fn apply_movement_emission_and_play_sound( &self, emission: EntityMovementEmission, clipped_movement: DVec3, effect_pos: BlockPos, effect_state: BlockStateId, )
Source§fn apply_movement_side_effects_after_move(
&self,
world: &World,
actual_movement: DVec3,
)
fn apply_movement_side_effects_after_move( &self, world: &World, actual_movement: DVec3, )
Source§fn vibration_and_sound_effects_from_block(
&self,
pos: BlockPos,
block_state: BlockStateId,
should_sound: bool,
should_vibrate: bool,
clipped_movement: DVec3,
) -> bool
fn vibration_and_sound_effects_from_block( &self, pos: BlockPos, block_state: BlockStateId, should_sound: bool, should_vibrate: bool, clipped_movement: DVec3, ) -> bool
Source§fn is_no_gravity(&self) -> bool
fn is_no_gravity(&self) -> bool
Source§fn set_no_gravity(&self, no_gravity: bool)
fn set_no_gravity(&self, no_gravity: bool)
NoGravity flag.Source§fn is_invulnerable(&self) -> bool
fn is_invulnerable(&self) -> bool
Invulnerable flag.Source§fn set_invulnerable(&self, invulnerable: bool)
fn set_invulnerable(&self, invulnerable: bool)
Invulnerable flag.Source§fn get_gravity(&self) -> f64
fn get_gravity(&self) -> f64
Source§fn apply_gravity(&self)
fn apply_gravity(&self)
Source§fn move_relative(&self, speed: f32, input: DVec3)
fn move_relative(&self, speed: f32, input: DVec3)
Entity.moveRelative().Source§fn move_without_physics(&self, delta: DVec3) -> Option<MoveResult>
fn move_without_physics(&self, delta: DVec3) -> Option<MoveResult>
Source§fn move_entity(&self, mover_type: MoverType, delta: DVec3) -> Option<MoveResult>
fn move_entity(&self, mover_type: MoverType, delta: DVec3) -> Option<MoveResult>
Source§fn apply_fall_damage_after_move(
&self,
result: &MoveResult,
world: &Arc<World>,
) -> bool
fn apply_fall_damage_after_move( &self, result: &MoveResult, world: &Arc<World>, ) -> bool
Source§fn reset_fall_distance_on_resetting_clip(
&self,
world: &Arc<World>,
movement: DVec3,
)
fn reset_fall_distance_on_resetting_clip( &self, world: &Arc<World>, movement: DVec3, )
Source§fn do_check_fall_damage(
&self,
movement: DVec3,
on_ground: bool,
world: &Arc<World>,
) -> bool
fn do_check_fall_damage( &self, movement: DVec3, on_ground: bool, world: &Arc<World>, ) -> bool
Entity.doCheckFallDamage. Read moreSource§fn refresh_supporting_block_for_fall_damage(
&self,
movement: DVec3,
on_ground: bool,
)
fn refresh_supporting_block_for_fall_damage( &self, movement: DVec3, on_ground: bool, )
Source§fn check_fall_damage(
&self,
vertical_movement: f64,
on_ground: bool,
on_state: BlockStateId,
pos: BlockPos,
world: &Arc<World>,
)
fn check_fall_damage( &self, vertical_movement: f64, on_ground: bool, on_state: BlockStateId, pos: BlockPos, world: &Arc<World>, )
Entity.checkFallDamage.Source§fn ground_contact_after_movement(
&self,
on_ground: bool,
movement: Option<DVec3>,
) -> EntityGroundContact
fn ground_contact_after_movement( &self, on_ground: bool, movement: Option<DVec3>, ) -> EntityGroundContact
Source§fn check_supporting_block(
&self,
on_ground: bool,
movement: Option<DVec3>,
world: &Arc<World>,
) -> EntityGroundContact
fn check_supporting_block( &self, on_ground: bool, movement: Option<DVec3>, world: &Arc<World>, ) -> EntityGroundContact
Entity.checkSupportingBlock.Source§fn spawn_at_location(
&self,
item: ItemStack,
y_offset: f64,
) -> Option<Arc<ItemEntity>>
fn spawn_at_location( &self, item: ItemStack, y_offset: f64, ) -> Option<Arc<ItemEntity>>
Source§fn spawn_at_location_with_offset(
&self,
item: ItemStack,
offset: DVec3,
) -> Option<Arc<ItemEntity>>
fn spawn_at_location_with_offset( &self, item: ItemStack, offset: DVec3, ) -> Option<Arc<ItemEntity>>
Source§fn save_additional(&self, _nbt: &mut NbtCompound)
fn save_additional(&self, _nbt: &mut NbtCompound)
Source§fn load_additional(&self, _nbt: BorrowedNbtCompoundView<'_, '_>)
fn load_additional(&self, _nbt: BorrowedNbtCompoundView<'_, '_>)
Source§impl LivingEntity for Player
impl LivingEntity for Player
Source§fn tick_living_entity(&self)
fn tick_living_entity(&self)
LivingEntity.tick. Read moreSource§fn get_health(&self) -> f32
fn get_health(&self) -> f32
Source§fn set_health(&self, health: f32)
fn set_health(&self, health: f32)
Source§fn living_base(&self) -> &LivingEntityBase
fn living_base(&self) -> &LivingEntityBase
LivingEntityBase that holds
living runtime state such as attributes, cached movement speed,
damage cooldown, and death animation counters.Source§fn can_be_seen_as_enemy(&self) -> bool
fn can_be_seen_as_enemy(&self) -> bool
LivingEntity.canBeSeenAsEnemy().Source§fn is_invulnerable_to(&self, world: &World, source: &DamageSource) -> bool
fn is_invulnerable_to(&self, world: &World, source: &DamageSource) -> bool
Source§fn hurt_armor(&self, source: &DamageSource, damage: f32)
fn hurt_armor(&self, source: &DamageSource, damage: f32)
Source§fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
Source§fn hurt_broadcast_chunk(&self) -> ChunkPos
fn hurt_broadcast_chunk(&self) -> ChunkPos
Source§fn die(&self, source: &DamageSource)
fn die(&self, source: &DamageSource)
Source§fn with_equipment_slot(
&self,
slot: EquipmentSlot,
visitor: &mut dyn FnMut(&ItemStack),
)
fn with_equipment_slot( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&ItemStack), )
Source§fn with_equipment_slot_mut(
&self,
slot: EquipmentSlot,
visitor: &mut dyn FnMut(&mut ItemStack),
)
fn with_equipment_slot_mut( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&mut ItemStack), )
Source§fn interact_living_entity_with_equippable(
&self,
player: &Player,
hand: InteractionHand,
) -> InteractionResult
fn interact_living_entity_with_equippable( &self, player: &Player, hand: InteractionHand, ) -> InteractionResult
ItemStack.interactLivingEntity branch.Source§fn has_infinite_materials(&self) -> bool
fn has_infinite_materials(&self) -> bool
Source§fn get_absorption_amount(&self) -> f32
fn get_absorption_amount(&self) -> f32
Source§fn set_absorption_amount(&self, amount: f32)
fn set_absorption_amount(&self, amount: f32)
Source§fn is_affected_by_fluids(&self) -> bool
fn is_affected_by_fluids(&self) -> bool
LivingEntity.isAffectedByFluids().Source§fn is_immobile(&self) -> bool
fn is_immobile(&self) -> bool
LivingEntity.isImmobile().Source§fn jump_from_ground(&self)
fn jump_from_ground(&self)
LivingEntity.jumpFromGround().Source§fn ai_step(&self) -> Option<MoveResult>
fn ai_step(&self) -> Option<MoveResult>
LivingEntity.aiStep().Source§fn get_flying_speed(&self) -> f32
fn get_flying_speed(&self) -> f32
LivingEntity.getFlyingSpeed().Source§fn living_rotation_state(&self) -> LivingRotationState
fn living_rotation_state(&self) -> LivingRotationState
Source§fn y_body_rot(&self) -> f32
fn y_body_rot(&self) -> f32
LivingEntity.yBodyRot.Source§fn set_y_body_rot(&self, y_body_rot: f32)
fn set_y_body_rot(&self, y_body_rot: f32)
LivingEntity.yBodyRot.Source§fn y_head_rot(&self) -> f32
fn y_head_rot(&self) -> f32
LivingEntity.yHeadRot.Source§fn set_y_head_rot(&self, y_head_rot: f32)
fn set_y_head_rot(&self, y_head_rot: f32)
LivingEntity.yHeadRot.Source§fn advance_living_rotation_for_base_tick(&self)
fn advance_living_rotation_for_base_tick(&self)
Source§fn advance_attack_animation_for_base_tick(&self)
fn advance_attack_animation_for_base_tick(&self)
Source§fn base_tick_living_entity(&self)
fn base_tick_living_entity(&self)
LivingEntity.baseTick.Source§fn living_swing_state(&self) -> LivingSwingState
fn living_swing_state(&self) -> LivingSwingState
Source§fn current_swing_duration(&self) -> i32
fn current_swing_duration(&self) -> i32
LivingEntity.getCurrentSwingDuration.Source§fn swing(&self, hand: InteractionHand, update_self: bool)
fn swing(&self, hand: InteractionHand, update_self: bool)
LivingEntity.swing.Source§fn update_swing_time(&self)
fn update_swing_time(&self)
LivingEntity.updateSwingTime.Source§fn attributes(&self) -> &SyncMutex<AttributeMap>
fn attributes(&self) -> &SyncMutex<AttributeMap>
Source§fn pack_syncable_attributes(&self) -> Vec<AttributeSnapshot>
fn pack_syncable_attributes(&self) -> Vec<AttributeSnapshot>
Source§fn drain_dirty_syncable_attributes(&self) -> Vec<AttributeSnapshot>
fn drain_dirty_syncable_attributes(&self) -> Vec<AttributeSnapshot>
Source§fn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange>
fn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange>
Source§fn pack_all_equipment(&self) -> Vec<EquipmentSlotItem>
fn pack_all_equipment(&self) -> Vec<EquipmentSlotItem>
Source§fn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem>
fn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem>
Source§fn save_command_nbt(&self, nbt: &mut NbtCompound)
fn save_command_nbt(&self, nbt: &mut NbtCompound)
Source§fn get_max_health(&self) -> f32
fn get_max_health(&self) -> f32
Source§fn no_action_time(&self) -> i32
fn no_action_time(&self) -> i32
LivingEntity.noActionTime.Source§fn set_no_action_time(&self, no_action_time: i32)
fn set_no_action_time(&self, no_action_time: i32)
LivingEntity.noActionTime.Source§fn increment_no_action_time(&self)
fn increment_no_action_time(&self)
LivingEntity.noActionTime.Source§fn is_dead_or_dying(&self) -> bool
fn is_dead_or_dying(&self) -> bool
Source§fn sound_volume(&self) -> f32
fn sound_volume(&self) -> f32
LivingEntity.getSoundVolume.Source§fn voice_pitch(&self) -> f32
fn voice_pitch(&self) -> f32
LivingEntity.getVoicePitch.Source§fn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef>
fn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef>
LivingEntity.getHurtSound.Source§fn death_sound(&self) -> Option<SoundEventRef>
fn death_sound(&self) -> Option<SoundEventRef>
LivingEntity.getDeathSound.Source§fn make_sound(&self, sound: Option<SoundEventRef>)
fn make_sound(&self, sound: Option<SoundEventRef>)
LivingEntity.makeSound.Source§fn play_hurt_sound(&self, source: &DamageSource)
fn play_hurt_sound(&self, source: &DamageSource)
LivingEntity.playHurtSound.Source§fn play_death_sound(&self)
fn play_death_sound(&self)
Source§fn get_age_scale(&self) -> f32
fn get_age_scale(&self) -> f32
LivingEntity.getAgeScale().Source§fn get_armor_cover_percentage(&self) -> f32
fn get_armor_cover_percentage(&self) -> f32
LivingEntity.getArmorCoverPercentage().Source§fn get_visibility_percent(&self, targeting_entity: Option<&dyn Entity>) -> f64
fn get_visibility_percent(&self, targeting_entity: Option<&dyn Entity>) -> f64
LivingEntity.getVisibilityPercent().Source§fn disguise_head_matches_targeting_entity(
&self,
targeting_entity: Option<&dyn Entity>,
) -> bool
fn disguise_head_matches_targeting_entity( &self, targeting_entity: Option<&dyn Entity>, ) -> bool
targeting_entity.Source§fn can_be_seen_by_anyone(&self) -> bool
fn can_be_seen_by_anyone(&self) -> bool
LivingEntity.canBeSeenByAnyone().Source§fn can_attack(&self, target: &dyn LivingEntity) -> bool
fn can_attack(&self, target: &dyn LivingEntity) -> bool
LivingEntity.canAttack().Source§fn last_damage_source(&self) -> Option<DamageSource>
fn last_damage_source(&self) -> Option<DamageSource>
LivingEntity.getLastDamageSource().Source§fn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32)
fn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32)
LivingEntity.lastHurtByPlayer.Source§fn last_hurt_by_player_memory_time(&self) -> i32
fn last_hurt_by_player_memory_time(&self) -> i32
LivingEntity.lastHurtByPlayerMemoryTime.Source§fn last_hurt_by_player_uuid(&self) -> Option<Uuid>
fn last_hurt_by_player_uuid(&self) -> Option<Uuid>
LivingEntity.lastHurtByPlayer, if still remembered.Source§fn last_hurt_by_mob(&self) -> Option<SharedEntity>
fn last_hurt_by_mob(&self) -> Option<SharedEntity>
LivingEntity.lastHurtByMob.Source§fn last_hurt_by_mob_timestamp(&self) -> i32
fn last_hurt_by_mob_timestamp(&self) -> i32
LivingEntity.lastHurtByMobTimestamp.Source§fn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>)
fn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>)
LivingEntity.lastHurtByMob.Source§fn last_hurt_mob(&self) -> Option<SharedEntity>
fn last_hurt_mob(&self) -> Option<SharedEntity>
LivingEntity.lastHurtMob.Source§fn last_hurt_mob_timestamp(&self) -> i32
fn last_hurt_mob_timestamp(&self) -> i32
LivingEntity.lastHurtMobTimestamp.Source§fn set_last_hurt_mob(&self, target: Option<&SharedEntity>)
fn set_last_hurt_mob(&self, target: Option<&SharedEntity>)
LivingEntity.lastHurtMob.Source§fn resolve_mob_responsible_for_damage(
&self,
world: &World,
source: &DamageSource,
)
fn resolve_mob_responsible_for_damage( &self, world: &World, source: &DamageSource, )
LivingEntity.resolveMobResponsibleForDamage.Source§fn resolve_player_responsible_for_damage(
&self,
world: &World,
source: &DamageSource,
)
fn resolve_player_responsible_for_damage( &self, world: &World, source: &DamageSource, )
LivingEntity.resolvePlayerResponsibleForDamage.Source§fn has_line_of_sight(&self, target: &dyn Entity) -> bool
fn has_line_of_sight(&self, target: &dyn Entity) -> bool
LivingEntity.hasLineOfSight().Source§fn has_line_of_sight_with(
&self,
target: &dyn Entity,
block_shape: ClipBlockShape,
fluid: ClipFluid,
target_eye_y: f64,
) -> bool
fn has_line_of_sight_with( &self, target: &dyn Entity, block_shape: ClipBlockShape, fluid: ClipFluid, target_eye_y: f64, ) -> bool
Source§fn default_is_invulnerable_to(&self, source: &DamageSource) -> bool
fn default_is_invulnerable_to(&self, source: &DamageSource) -> bool
Source§fn hurt_server(&self, world: &World, source: &DamageSource, amount: f32) -> bool
fn hurt_server(&self, world: &World, source: &DamageSource, amount: f32) -> bool
Source§fn before_actually_hurt(&self, _source: &DamageSource, _amount: f32)
fn before_actually_hurt(&self, _source: &DamageSource, _amount: f32)
Source§fn do_hurt_equipment(
&self,
source: &DamageSource,
damage: f32,
slots: &[EquipmentSlot],
)
fn do_hurt_equipment( &self, source: &DamageSource, damage: f32, slots: &[EquipmentSlot], )
LivingEntity.doHurtEquipment.Source§fn get_damage_after_armor_absorb(
&self,
source: &DamageSource,
damage: f32,
) -> f32
fn get_damage_after_armor_absorb( &self, source: &DamageSource, damage: f32, ) -> f32
LivingEntity.getDamageAfterArmorAbsorb.Source§fn get_damage_after_magic_absorb(
&self,
source: &DamageSource,
damage: f32,
) -> f32
fn get_damage_after_magic_absorb( &self, source: &DamageSource, damage: f32, ) -> f32
LivingEntity.getDamageAfterMagicAbsorb.Source§fn apply_damage_knockback(&self, source: &DamageSource)
fn apply_damage_knockback(&self, source: &DamageSource)
Source§fn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64)
fn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64)
Source§fn knockback_resistance(&self) -> f64
fn knockback_resistance(&self) -> f64
Source§fn indicate_damage(&self, _xd: f64, _zd: f64)
fn indicate_damage(&self, _xd: f64, _zd: f64)
LivingEntity.indicateDamage.Source§fn broadcast_damage_event(&self, world: &World, source: &DamageSource)
fn broadcast_damage_event(&self, world: &World, source: &DamageSource)
Source§fn broadcast_hurt_animation(&self, world: &World)
fn broadcast_hurt_animation(&self, world: &World)
Source§fn should_drop_loot(&self, world: &World) -> bool
fn should_drop_loot(&self, world: &World) -> bool
LivingEntity.shouldDropLoot.Source§fn should_drop_experience(&self) -> bool
fn should_drop_experience(&self) -> bool
LivingEntity.shouldDropExperience.Source§fn is_always_experience_dropper(&self) -> bool
fn is_always_experience_dropper(&self) -> bool
LivingEntity.isAlwaysExperienceDropper.Source§fn skip_drop_experience(&self)
fn skip_drop_experience(&self)
LivingEntity.skipDropExperience.Source§fn was_experience_consumed(&self) -> bool
fn was_experience_consumed(&self) -> bool
LivingEntity.wasExperienceConsumed.Source§fn base_experience_reward(&self) -> i32
fn base_experience_reward(&self) -> i32
LivingEntity.getBaseExperienceReward.Source§fn experience_reward(
&self,
_world: &World,
_killer_entity_id: Option<i32>,
) -> i32
fn experience_reward( &self, _world: &World, _killer_entity_id: Option<i32>, ) -> i32
LivingEntity.getExperienceReward.Source§fn drop_all_death_loot(&self, source: &DamageSource)
fn drop_all_death_loot(&self, source: &DamageSource)
LivingEntity.dropAllDeathLoot.Source§fn drop_experience(&self, world: &Arc<World>, killer_entity_id: Option<i32>)
fn drop_experience(&self, world: &Arc<World>, killer_entity_id: Option<i32>)
LivingEntity.dropExperience.Source§fn death_loot_table(&self) -> Option<LootTableRef>
fn death_loot_table(&self) -> Option<LootTableRef>
LivingEntity.dropFromLootTable.Source§fn death_loot_table_seed(&self) -> i64
fn death_loot_table_seed(&self) -> i64
Entity.getLootTableSeed for death loot.Source§fn drop_from_loot_table(&self, source: &DamageSource, killed_by_player: bool)
fn drop_from_loot_table(&self, source: &DamageSource, killed_by_player: bool)
LivingEntity.dropFromLootTable.Source§fn drop_custom_death_loot(
&self,
_source: &DamageSource,
_killed_by_player: bool,
)
fn drop_custom_death_loot( &self, _source: &DamageSource, _killed_by_player: bool, )
Source§fn tick_death(&self)
fn tick_death(&self)
Source§fn fall_damage_sound(&self, damage: i32) -> SoundEventRef
fn fall_damage_sound(&self, damage: i32) -> SoundEventRef
LivingEntity.getFallDamageSound().Source§fn play_block_fall_sound(&self)
fn play_block_fall_sound(&self)
LivingEntity.playBlockFallSound().Source§fn cause_living_fall_damage(
&self,
fall_distance: f64,
damage_modifier: f32,
source: &DamageSource,
) -> bool
fn cause_living_fall_damage( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool
LivingEntity.causeFallDamage.Source§fn get_armor_value(&self) -> i32
fn get_armor_value(&self) -> i32
Source§fn get_attribute_gravity(&self) -> f64
fn get_attribute_gravity(&self) -> f64
Source§fn get_effective_gravity(&self) -> f64
fn get_effective_gravity(&self) -> f64
LivingEntity.getEffectiveGravity().Source§fn is_affected_by_potions(&self) -> bool
fn is_affected_by_potions(&self) -> bool
Source§fn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool
fn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool
LivingEntity.canBeAffected eligibility.Source§fn can_be_affected(&self, effect: &MobEffectInstance) -> bool
fn can_be_affected(&self, effect: &MobEffectInstance) -> bool
Source§fn has_mob_effect(&self, effect: MobEffectRef) -> bool
fn has_mob_effect(&self, effect: MobEffectRef) -> bool
LivingEntity.hasEffect().Source§fn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect>
fn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect>
LivingEntity.getEffect().Source§fn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ
fn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ
Source§fn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32)
fn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32)
Source§fn add_mob_effect(&self, effect: MobEffectInstance) -> bool
fn add_mob_effect(&self, effect: MobEffectInstance) -> bool
Source§fn set_mob_effect_active(&self, effect: MobEffectRef, active: bool)
fn set_mob_effect_active(&self, effect: MobEffectRef, active: bool)
Source§fn remove_mob_effect(&self, effect: MobEffectRef) -> bool
fn remove_mob_effect(&self, effect: MobEffectRef) -> bool
Source§fn tick_mob_effects(&self)
fn tick_mob_effects(&self)
Source§fn has_water_breathing(&self) -> bool
fn has_water_breathing(&self) -> bool
Source§fn should_effects_refill_air_supply(&self) -> bool
fn should_effects_refill_air_supply(&self) -> bool
Source§fn can_breathe_underwater(&self) -> bool
fn can_breathe_underwater(&self) -> bool
LivingEntity.canBreatheUnderwater.Source§fn can_drown_in_water(&self) -> bool
fn can_drown_in_water(&self) -> bool
Source§fn is_eye_in_bubble_column(&self) -> bool
fn is_eye_in_bubble_column(&self) -> bool
Source§fn decrease_air_supply(&self, current_supply: i32) -> i32
fn decrease_air_supply(&self, current_supply: i32) -> i32
LivingEntity.decreaseAirSupply.Source§fn increase_air_supply(&self, current_supply: i32) -> i32
fn increase_air_supply(&self, current_supply: i32) -> i32
LivingEntity.increaseAirSupply.Source§fn should_take_drowning_damage(&self) -> bool
fn should_take_drowning_damage(&self) -> bool
LivingEntity.shouldTakeDrowningDamage.Source§fn tick_living_air_supply(&self)
fn tick_living_air_supply(&self)
baseTick.Source§fn is_in_wall(&self) -> bool
fn is_in_wall(&self) -> bool
LivingEntity.isInWall.Source§fn tick_in_wall_damage(&self)
fn tick_in_wall_damage(&self)
baseTick.Source§fn tick_living_environmental_damage(&self)
fn tick_living_environmental_damage(&self)
LivingEntity.baseTick order.Source§fn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool
fn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool
LivingEntity.canStandOnFluid().Source§fn is_using_item(&self) -> bool
fn is_using_item(&self) -> bool
Source§fn is_blocking(&self) -> bool
fn is_blocking(&self) -> bool
Source§fn is_fall_flying(&self) -> bool
fn is_fall_flying(&self) -> bool
Source§fn set_fall_flying(&self, fall_flying: bool)
fn set_fall_flying(&self, fall_flying: bool)
Source§fn fall_flying_ticks(&self) -> i32
fn fall_flying_ticks(&self) -> i32
LivingEntity.getFallFlyingTicks().Source§fn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool
fn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool
LivingEntity.isHolding.Source§fn has_item_in_slot(&self, slot: EquipmentSlot) -> bool
fn has_item_in_slot(&self, slot: EquipmentSlot) -> bool
slot.Source§fn can_use_slot(&self, _slot: EquipmentSlot) -> bool
fn can_use_slot(&self, _slot: EquipmentSlot) -> bool
slot.Source§fn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool
fn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool
Source§fn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool
fn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool
LivingEntity.canEquipWithDispenser.Source§fn is_equippable_in_slot(
&self,
item_stack: &ItemStack,
slot: EquipmentSlot,
) -> bool
fn is_equippable_in_slot( &self, item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool
LivingEntity.isEquippableInSlot.Source§fn equip_sound(
&self,
slot: EquipmentSlot,
stack: &ItemStack,
) -> Option<SoundEventRef>
fn equip_sound( &self, slot: EquipmentSlot, stack: &ItemStack, ) -> Option<SoundEventRef>
Source§fn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot)
fn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot)
Source§fn detect_equipment_updates(&self)
fn detect_equipment_updates(&self)
Source§fn pack_living_equipment(&self) -> Vec<EquipmentSlotItem>
fn pack_living_equipment(&self) -> Vec<EquipmentSlotItem>
Source§fn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem>
fn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem>
Source§fn on_equipped_item_broken(&self, slot: EquipmentSlot)
fn on_equipped_item_broken(&self, slot: EquipmentSlot)
Source§fn default_living_can_freeze(&self) -> bool
fn default_living_can_freeze(&self) -> bool
LivingEntity.canFreeze() after concrete entity exemptions. Read moreSource§fn is_on_non_air_block_for_frost(&self) -> bool
fn is_on_non_air_block_for_frost(&self) -> bool
tryAddFrost sees a non-air block below.Source§fn remove_frost(&self)
fn remove_frost(&self)
LivingEntity.removeFrost.Source§fn try_add_frost(&self)
fn try_add_frost(&self)
LivingEntity.tryAddFrost.Source§fn tick_freezing(&self)
fn tick_freezing(&self)
LivingEntity.aiStep freezing effects.Source§fn tick_living_state(&self)
fn tick_living_state(&self)
Source§fn can_glide_using(&self, item_stack: &ItemStack, slot: EquipmentSlot) -> bool
fn can_glide_using(&self, item_stack: &ItemStack, slot: EquipmentSlot) -> bool
LivingEntity.canGlideUsing().Source§fn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool
fn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool
slot can be used for vanilla gliding.Source§fn damage_random_glider(&self)
fn damage_random_glider(&self)
LivingEntity.updateFallFlying().Source§fn default_can_glide(&self) -> bool
fn default_can_glide(&self) -> bool
LivingEntity.canGlide() implementation for overrides.Source§fn start_fall_flying(&self)
fn start_fall_flying(&self)
Player.startFallFlying().Source§fn try_to_start_fall_flying(&self) -> bool
fn try_to_start_fall_flying(&self) -> bool
Player.tryToStartFallFlying().Source§fn last_climbable_pos(&self) -> Option<BlockPos>
fn last_climbable_pos(&self) -> Option<BlockPos>
Source§fn set_last_climbable_pos(&self, pos: BlockPos)
fn set_last_climbable_pos(&self, pos: BlockPos)
Source§fn default_living_on_climbable(&self) -> bool
fn default_living_on_climbable(&self) -> bool
LivingEntity.onClimbable() behavior.Source§fn should_discard_friction(&self) -> bool
fn should_discard_friction(&self) -> bool
Source§fn set_discard_friction(&self, discard_friction: bool)
fn set_discard_friction(&self, discard_friction: bool)
Source§fn is_jumping(&self) -> bool
fn is_jumping(&self) -> bool
Source§fn set_jumping(&self, jumping: bool)
fn set_jumping(&self, jumping: bool)
Source§fn travel_input(&self) -> LivingTravelInput
fn travel_input(&self) -> LivingTravelInput
Source§fn set_travel_input(&self, input: LivingTravelInput)
fn set_travel_input(&self, input: LivingTravelInput)
Source§fn apply_input(&self)
fn apply_input(&self)
LivingEntity.applyInput() damping.Source§fn no_jump_delay(&self) -> i32
fn no_jump_delay(&self) -> i32
Source§fn set_no_jump_delay(&self, ticks: i32)
fn set_no_jump_delay(&self, ticks: i32)
Source§fn tick_no_jump_delay(&self)
fn tick_no_jump_delay(&self)
Source§fn default_is_immobile(&self) -> bool
fn default_is_immobile(&self) -> bool
LivingEntity.isImmobile().Source§fn apply_living_velocity_thresholds(&self)
fn apply_living_velocity_thresholds(&self)
LivingEntity.aiStep() velocity thresholds.Source§fn server_ai_step(&self)
fn server_ai_step(&self)
LivingEntity.aiStep().Source§fn get_jump_boost_power(&self) -> f32
fn get_jump_boost_power(&self) -> f32
LivingEntity.getJumpBoostPower().Source§fn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32
fn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32
LivingEntity.getJumpPower(float).Source§fn get_jump_power(&self) -> f32
fn get_jump_power(&self) -> f32
LivingEntity.getJumpPower().Source§fn default_jump_from_ground(&self)
fn default_jump_from_ground(&self)
LivingEntity.jumpFromGround() implementation for overrides.Source§fn go_down_in_water(&self)
fn go_down_in_water(&self)
LivingEntity.goDownInWater().Source§fn jump_in_liquid(&self, _fluid_tag: &Identifier)
fn jump_in_liquid(&self, _fluid_tag: &Identifier)
LivingEntity.jumpInLiquid().Source§fn handle_living_jump(&self)
fn handle_living_jump(&self)
LivingEntity.aiStep() jump handling.Source§fn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3)
fn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3)
LivingEntity.tickRidden().Source§fn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3
fn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3
LivingEntity.getRiddenInput().Source§fn ridden_speed(&self, _controller: &Player) -> f32
fn ridden_speed(&self, _controller: &Player) -> f32
LivingEntity.getRiddenSpeed().Source§fn travel_ridden(
&self,
controller: &Player,
self_input: DVec3,
) -> Option<MoveResult>
fn travel_ridden( &self, controller: &Player, self_input: DVec3, ) -> Option<MoveResult>
LivingEntity.travelRidden().Source§fn default_ai_step(&self) -> Option<MoveResult>
fn default_ai_step(&self) -> Option<MoveResult>
LivingEntity.aiStep() movement foundation for overrides. Read moreSource§fn push_entities(&self)
fn push_entities(&self)
LivingEntity.pushEntities().Source§fn apply_entity_cramming_damage(
&self,
world: &World,
pushable_entities: &[SharedEntity],
)
fn apply_entity_cramming_damage( &self, world: &World, pushable_entities: &[SharedEntity], )
LivingEntity.pushEntities().Source§fn is_suppressing_sliding_down_ladder(&self) -> bool
fn is_suppressing_sliding_down_ladder(&self) -> bool
LivingEntity.isSuppressingSlidingDownLadder().Source§fn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64>
fn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64>
travelInAir.Source§fn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool
fn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool
LivingEntity.travel() should use fluid movement.Source§fn get_water_slow_down(&self) -> f32
fn get_water_slow_down(&self) -> f32
LivingEntity.getWaterSlowDown().Source§fn water_movement_efficiency(&self) -> f32
fn water_movement_efficiency(&self) -> f32
Source§fn has_dolphins_grace(&self) -> bool
fn has_dolphins_grace(&self) -> bool
Source§fn get_friction_influenced_speed(&self, block_friction: f32) -> f32
fn get_friction_influenced_speed(&self, block_friction: f32) -> f32
LivingEntity.getFrictionInfluencedSpeed().Source§fn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32
fn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32
travelInAir.Source§fn handle_on_climbable(&self, movement: DVec3) -> DVec3
fn handle_on_climbable(&self, movement: DVec3) -> DVec3
LivingEntity.handleOnClimbable().Source§fn apply_living_travel_gravity(&self)
fn apply_living_travel_gravity(&self)
Source§fn handle_relative_friction_and_calculate_movement(
&self,
input: DVec3,
block_friction: f32,
) -> Option<(DVec3, MoveResult)>
fn handle_relative_friction_and_calculate_movement( &self, input: DVec3, block_friction: f32, ) -> Option<(DVec3, MoveResult)>
LivingEntity.handleRelativeFrictionAndCalculateMovement().Source§fn travel_in_air(&self, input: DVec3) -> Option<MoveResult>
fn travel_in_air(&self, input: DVec3) -> Option<MoveResult>
LivingEntity.travelInAir().Source§fn get_fluid_falling_adjusted_movement(
&self,
base_gravity: f64,
is_falling: bool,
movement: DVec3,
) -> DVec3
fn get_fluid_falling_adjusted_movement( &self, base_gravity: f64, is_falling: bool, movement: DVec3, ) -> DVec3
LivingEntity.getFluidFallingAdjustedMovement().Source§fn jump_out_of_fluid(&self, old_y: f64)
fn jump_out_of_fluid(&self, old_y: f64)
LivingEntity.jumpOutOfFluid().Source§fn float_in_water_while_ridden(&self)
fn float_in_water_while_ridden(&self)
LivingEntity.floatInWaterWhileRidden().Source§fn travel_in_water(
&self,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult>
fn travel_in_water( &self, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>
LivingEntity.travelInWater().Source§fn travel_in_lava(
&self,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult>
fn travel_in_lava( &self, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>
LivingEntity.travelInLava().Source§fn travel_in_fluid(&self, input: DVec3) -> Option<MoveResult>
fn travel_in_fluid(&self, input: DVec3) -> Option<MoveResult>
LivingEntity.travelInFluid().Source§fn update_fall_flying(&self)
fn update_fall_flying(&self)
LivingEntity.updateFallFlying().Source§fn update_fall_flying_movement(&self, movement: DVec3) -> DVec3
fn update_fall_flying_movement(&self, movement: DVec3) -> DVec3
LivingEntity.updateFallFlyingMovement().Source§fn stop_fall_flying(&self)
fn stop_fall_flying(&self)
LivingEntity.stopFallFlying().Source§fn handle_fall_flying_collisions(
&self,
previous_horizontal_speed: f64,
new_horizontal_speed: f64,
)
fn handle_fall_flying_collisions( &self, previous_horizontal_speed: f64, new_horizontal_speed: f64, )
LivingEntity.handleFallFlyingCollisions().Source§fn travel_fall_flying(&self, input: DVec3) -> Option<MoveResult>
fn travel_fall_flying(&self, input: DVec3) -> Option<MoveResult>
LivingEntity.travelFallFlying().Source§fn default_travel(&self, input: DVec3) -> Option<MoveResult>
fn default_travel(&self, input: DVec3) -> Option<MoveResult>
LivingEntity.travel() implementation for overrides.Source§fn sleeping_pos(&self) -> Option<BlockPos>
fn sleeping_pos(&self) -> Option<BlockPos>
Source§fn set_sleeping_pos(&self, bed_position: BlockPos)
fn set_sleeping_pos(&self, bed_position: BlockPos)
Source§fn clear_sleeping_pos(&self)
fn clear_sleeping_pos(&self)
Source§fn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
Source§fn stop_sleeping(&self)
fn stop_sleeping(&self)
Source§fn is_sprinting(&self) -> bool
fn is_sprinting(&self) -> bool
Source§fn set_sprinting(&self, sprinting: bool)
fn set_sprinting(&self, sprinting: bool)
Source§fn apply_post_impulse_grace_time(&self, ticks: i32)
fn apply_post_impulse_grace_time(&self, ticks: i32)
Source§fn set_ignore_fall_damage_from_current_impulse(
&self,
ignore_fall_damage: bool,
new_impulse_impact_pos: DVec3,
)
fn set_ignore_fall_damage_from_current_impulse( &self, ignore_fall_damage: bool, new_impulse_impact_pos: DVec3, )
LivingEntity.setIgnoreFallDamageFromCurrentImpulse.Source§fn is_ignoring_fall_damage_from_current_impulse(&self) -> bool
fn is_ignoring_fall_damage_from_current_impulse(&self) -> bool
LivingEntity.isIgnoringFallDamageFromCurrentImpulse.Source§fn current_impulse_impact_pos(&self) -> Option<DVec3>
fn current_impulse_impact_pos(&self) -> Option<DVec3>
LivingEntity.currentImpulseImpactPos.Source§fn try_reset_current_impulse_context(&self)
fn try_reset_current_impulse_context(&self)
LivingEntity.tryResetCurrentImpulseContext.Source§fn reset_current_impulse_context(&self)
fn reset_current_impulse_context(&self)
LivingEntity.resetCurrentImpulseContext.Source§fn is_in_post_impulse_grace_time(&self) -> bool
fn is_in_post_impulse_grace_time(&self) -> bool
Source§fn tick_post_impulse_grace_time(&self)
fn tick_post_impulse_grace_time(&self)
Source§fn refresh_dirty_attributes(&self)
fn refresh_dirty_attributes(&self)
Source§impl TextResolutor for Player
impl TextResolutor for Player
fn resolve_content(&self, _resolvable: &Resolvable) -> TextComponent
fn resolve_custom(&self, _data: &CustomData) -> Option<TextComponent>
fn translate(&self, _key: &str) -> Option<String>
fn resolve_other(&self, content: &Content) -> TextComponent
fn split_translation(&self, text: String) -> Vec<(String, usize)>
Auto Trait Implementations§
impl !Freeze for Player
impl !RefUnwindSafe for Player
impl !UnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnsafeUnpin for Player
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> Downcast for Twhere
T: ErasedType + ?Sized,
impl<T> Downcast for Twhere
T: ErasedType + ?Sized,
Source§fn is<T>(&self) -> boolwhere
T: DowncastType,
fn is<T>(&self) -> boolwhere
T: DowncastType,
T.Source§fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
T when its key matches.Source§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
T when its key matches.Source§impl<T> EntityEventSource for Twhere
T: Entity,
impl<T> EntityEventSource for Twhere
T: Entity,
Source§fn as_entity_event_source(&self) -> &(dyn Entity + 'static)
fn as_entity_event_source(&self) -> &(dyn Entity + 'static)
Source§impl<T> ErasedType for Twhere
T: DowncastType,
impl<T> ErasedType for Twhere
T: DowncastType,
fn downcast_type_key(&self) -> DowncastTypeKey
fn downcast_data(&self) -> *const ()
fn downcast_data_mut(&mut self) -> *mut ()
§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<>>