pub struct Client {
    pub read_conn: Arc<Mutex<ReadConnection<ClientboundGamePacket>>>,
    pub write_conn: Arc<Mutex<WriteConnection<ServerboundGamePacket>>>,
    pub player: Arc<Mutex<RawMutex, Player>>,
    pub dimension: Arc<Mutex<RawMutex, Dimension>>,
    pub physics_state: Arc<Mutex<RawMutex, PhysicsState>>,
    /* private fields */
}
Expand description

A player that you can control that is currently in a Minecraft server.

Fields

read_conn: Arc<Mutex<ReadConnection<ClientboundGamePacket>>>write_conn: Arc<Mutex<WriteConnection<ServerboundGamePacket>>>player: Arc<Mutex<RawMutex, Player>>dimension: Arc<Mutex<RawMutex, Dimension>>physics_state: Arc<Mutex<RawMutex, PhysicsState>>

Implementations

Sends chat message to the server. This only sends the chat packet and not the command packet. The chat function handles checking whether the message is a command and using the proper packet for you.

Send a command packet to the server. The command argument should not include the slash at the front.

Connect to a Minecraft server with an account.

Write a packet directly to the server.

Disconnect from the server, ending all tasks.

Returns the entity associated to the player.

Returns the entity associated to the player.

This gets called every tick.

Start walking in the given direction.

Toggle whether we’re jumping. This acts as if you held space in vanilla. If you want to jump once, use the jump function.

If you’re making a realistic client, calling this function every tick is recommended.

Returns whether the player will try to jump next tick.

Trait Implementations

Try to jump next tick.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more