Struct PlayerInput
#[non_exhaustive]pub struct PlayerInput {
pub forward: f32,
pub strafe: f32,
pub jump: bool,
pub sneak: bool,
pub sprint: bool,
pub yaw: f32,
pub pitch: f32,
pub velocity: Option<[f64; 3]>,
}Expand description
One tick of a bot’s keys for native_simulate_player_move, as a client’s input is
(ClientInput, LocalPlayer.aiStep).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.forward: f32Forward (1) or back (-1); in between is a stick’s partial push.
strafe: f32Left (1) or right (-1), as vanilla’s leftImpulse.
jump: boolJump is held.
sneak: boolSneak is held.
sprint: boolSprint is held; it sprints only while moving forward.
yaw: f32Where the body faces, in degrees (Entity.getYRot, getXRot).
pitch: f32Vertical look angle in degrees.
velocity: Option<[f64; 3]>The velocity to start from (the last call’s answer), in blocks a tick; None takes the server’s copy of the player.
Trait Implementations§
§impl Clone for PlayerInput
impl Clone for PlayerInput
§fn clone(&self) -> PlayerInput
fn clone(&self) -> PlayerInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PlayerInput
§impl Debug for PlayerInput
impl Debug for PlayerInput
§impl Default for PlayerInput
impl Default for PlayerInput
§fn default() -> PlayerInput
fn default() -> PlayerInput
Returns the “default value” for a type. Read more
§impl PartialEq for PlayerInput
impl PartialEq for PlayerInput
impl StructuralPartialEq for PlayerInput
Auto Trait Implementations§
impl Freeze for PlayerInput
impl RefUnwindSafe for PlayerInput
impl Send for PlayerInput
impl Sync for PlayerInput
impl Unpin for PlayerInput
impl UnsafeUnpin for PlayerInput
impl UnwindSafe for PlayerInput
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
Mutably borrows from an owned value. Read more