pub enum ConnectionState {
Handshake,
Status,
Login,
Configuration,
Play,
}Expand description
The connection states in the Minecraft protocol.
A Minecraft connection progresses through these states in order: Handshake → Status or Login → Configuration → Play. Each state has its own set of valid packets (both serverbound and clientbound), and the packet ID space is independent per state — the same ID can mean different packets in different states.
The Handshake state is special: it contains only one serverbound packet that determines whether the connection transitions to Status (server list ping) or Login (joining the game).
Variants§
Handshake
Initial state. The client sends a single Handshake packet that declares the protocol version and whether it wants Status or Login.
Status
Server list ping. The client requests server info (MOTD, player count, icon) and latency measurement. No authentication occurs.
Login
Authentication and encryption setup. The client and server exchange login credentials, enable encryption (AES/CFB-8), and optionally enable compression. Ends with Login Success.
Configuration
Post-login configuration. Registry data, resource packs, and feature flags are exchanged before entering gameplay. Added in Minecraft 1.20.2.
Play
Active gameplay. The majority of packets (movement, block changes, chat, entity updates, chunk data) are exchanged in this state.
Implementations§
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionState
impl Debug for ConnectionState
Source§impl Display for ConnectionState
impl Display for ConnectionState
Source§impl Hash for ConnectionState
impl Hash for ConnectionState
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
impl Copy for ConnectionState
impl Eq for ConnectionState
impl StructuralPartialEq for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnsafeUnpin for ConnectionState
impl UnwindSafe for ConnectionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.