Skip to main content

Capabilities

Struct Capabilities 

Source
#[non_exhaustive]
pub struct Capabilities {
Show 45 fields pub version: GameVersion, pub protocol: i32, pub physics: PhysicsRules, pub data: DataSet, pub item_model: ItemModel, pub combat_1_9: bool, pub entity_pick_root_vehicle: bool, pub eye_height: f64, pub sneak_eye_height: f64, pub chat_limit: usize, pub immediate_respawn_rule: bool, pub seed_planting_prediction: bool, pub teleport_confirm: bool, pub window_confirm: bool, pub configuration_state: bool, pub sneak_via_player_input: bool, pub sends_tick_end: bool, pub player_loaded_gate: bool, pub chunk_batch_ack: bool, pub block_sequence: bool, pub chat_acknowledgements: bool, pub drop_prediction: bool, pub client_entity_push: bool, pub spectator_block_click_swings: bool, pub spectator_switch_stops_use: bool, pub attack_knockback_enchantment: bool, pub use_equip_swings: bool, pub own_inventory_passes_keys: bool, pub use_stop: UseStop, pub creative_instant_dig: bool, pub invulnerable_eating: InvulnerableEating, pub living_flags_drive_use: bool, pub cooldown_reset: CooldownReset, pub item_cooldowns: ItemCooldownRules, pub pick_head_yaw: bool, pub legacy_pick_block: bool, pub sends_swing: bool, pub teleport_confirm_pose: bool, pub dig_change_direction: bool, pub creative_attack_dig_delay: bool, pub sends_punch: bool, pub boss_bars: bool, pub sign_editor: SignRules, pub book: BookRules, pub sleep_levels_pitch: bool,
}
Expand description

What a protocol version can do: the facts the client core asks for.

Read one with GameVersion::caps.

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.
§version: GameVersion

The version this row describes.

§protocol: i32

Protocol number.

§physics: PhysicsRules

Physics rule set.

§data: DataSet

Data tables.

§item_model: ItemModel

How item stacks carry extra data.

§combat_1_9: bool

1.9 combat: attack cooldown, swing sent after the click packet, the off hand.

§entity_pick_root_vehicle: bool

The crosshair pick skips entities with the player’s root vehicle (1.9+), not only the vehicle the player sits on (1.8).

§eye_height: f64

Eye height above the feet while standing.

§sneak_eye_height: f64

Eye height while sneaking (1.54 in 1.8 – 1.12, the crouching pose’s 1.27 since 1.14).

§chat_limit: usize

Longest chat line the server accepts, in UTF-16 units.

§immediate_respawn_rule: bool

Game event 11 (“immediate respawn” game rule) exists (1.15+).

§seed_planting_prediction: bool

The client uses a seed item at once when planting on its soil (the 1.8 SeedItem.use prediction; later versions wait for the server’s slot update).

§teleport_confirm: bool

Server teleports carry an id the client confirms (1.9+).

§window_confirm: bool

Window clicks are confirmed with transactions (1.8 – 1.16).

§configuration_state: bool

A configuration state sits between login and play (1.20.2+).

§sneak_via_player_input: bool

Sneaking is sent as player_input key state, not as an entity action (1.21.2+).

§sends_tick_end: bool

The client sends tick_end after every tick (1.21.2+).

§player_loaded_gate: bool

The player does not tick until the client sends player_loaded (1.21.4+).

§chunk_batch_ack: bool

Chunk batches are acknowledged with the desired chunks per tick (1.20.2+).

§block_sequence: bool

Dig / place / use packets carry a sequence number the server acknowledges (1.19+).

§chat_acknowledgements: bool

Chat packets carry a timestamp, salt and message acknowledgements (1.19.3+).

§drop_prediction: bool

The drop key takes the item off the held stack on the client at once and then swings the main arm when it took one (1.16.5 ClientPlayerEntity.dropSelectedItem and the key handler; 26.1 LocalPlayer.drop); 1.8.9 / 1.12.2 only send the packet and wait for the server’s slot update.

§client_entity_push: bool

The client itself pushes the player away from other entities in its entity tick (26.1+; 1.12.2: LivingEntity.tickCramming, other players and boats push the local player on the client too; 1.16.5: LivingEntity.tickCramming, OtherClientPlayerEntity.tickMovement and BoatEntity.tick, in the client world’s entity map order; 1.8.9 leaves it to the server). Judging those pushes needs each player entity’s tab-list name (team collision rules) and game mode (spectators do not push), so entity tracking then also keeps a names-only tab list.

§spectator_block_click_swings: bool

A spectator’s right click on a block (the block packet, then the click ends) swings the arm: 1.8 – 1.16 interactBlock returns true / SUCCESS for spectators; 26.1 / 26.2 MultiPlayerGameMode.performUseItemOn returns CONSUME, which swings nothing.

§spectator_switch_stops_use: bool

Switching to spectator ends an item use at once: 26.1 / 26.2 ServerPlayer.setGameMode(SPECTATOR) calls stopUsingItem and the client’s use ends with the living flags; 1.8 – 1.16.5 stop nothing (the use runs until release or finish).

§attack_knockback_enchantment: bool

The client’s attack reads the held item’s knockback enchantment level (EnchantmentHelper.getKnockback, 1.8 – 1.16.5): with knockback the attacker slows down on the client too. 26.1 / 26.2 LivingEntity.getKnockback runs the data-driven enchantment effects only on a ServerLevel: the client’s knockback is the attribute alone (a sprint attack at full strength still slows).

§use_equip_swings: bool

Putting armor on with a right click swings the arm: 1.16.5 ArmorItem.use answers success(…, isClient) (SUCCESS swings) and 26.x Equippable.swapWithEquipmentSlot SUCCESS (a client swing); 1.12.2 ArmorItem.use SUCCESS swings nothing, 1.8 interactItem neither.

§own_inventory_passes_keys: bool

The player’s own inventory screen passes key presses through to the game while it is open (1.16.5 InventoryScreen / CreativeInventoryScreen set passEvents: GLFW key events the screen does not use reach the key bindings, and handleInputEvents runs): opening it releases every key (KeyBinding.unpressAll), a movement key pressed while it is open applies, closing it re-reads the held keys. 1.8.9 / 1.12.2 screens take every keyboard event (handleInput before tickKeyboard), 26.x not verified (off).

§use_stop: UseStop

When a change of the used hand’s stack ends an item use.

§creative_instant_dig: bool

Creative digging as attackBlock / updateBlockBreakingProgress (26.x startDestroyBlock / continueDestroyBlock) do it: a start packet and the block broken at once (not by a sword, 26.x: a tool that cannot destroy blocks in creative), then every 5 ticks while the button is held; nothing is aborted (oracle: 26.x held_dig.jsonl.gz). Off: the survival path.

§invulnerable_eating: InvulnerableEating

What an invulnerable (creative) player may eat (canConsume).

§living_flags_drive_use: bool

Our living flags from the server drive the client’s item use (1.9+ ClientPlayerEntity.onTrackedDataSet(LIVING_FLAGS)): bit 1 set while not using starts a use of the stack in the hand of bit 2, bit 1 clear while using ends it (no packet).

§cooldown_reset: CooldownReset

When a held item change resets the 1.9+ attack cooldown.

§item_cooldowns: ItemCooldownRules

Item cooldowns: none, per item or per cooldown group.

§pick_head_yaw: bool

The key handling’s crosshair pick turns with the player’s head yaw (1.8 LivingEntity.getRotationVector(1.0F): the head yaw the last tick’s tickNewAi set, so the yaw before this tick’s turn) and this tick’s pitch; the movement packet carries the new yaw. 1.9+ picks with this tick’s yaw.

§legacy_pick_block: bool

The pick block key as 1.8.9 / 1.12.2 / 1.16.5 MinecraftClient.doPick ends (1.8 PlayerInventory.addPickBlock of an item and damage, 1.12 method_13250 / 1.16.5 addPickBlock of a stack) and, in creative mode, a creative_inventory_action for the selected slot (oracle clicks_creative); 1.12.2 / 1.16.5 also load saved toolbars. Off: not modelled (refused).

§sends_swing: bool

The client sends its arm swings (swing / arm_animation); 26.3 removed the serverbound swing: an attack sends the payload-less punch instead and a used item only animates the hand (LocalPlayer.itemUsed).

§teleport_confirm_pose: bool

26.3 ClientPacketListener.handleMovePlayer: the teleport answer is one accept_teleportation carrying the resulting position and rotation (no position-rotation packet after it), and the teleport aborts a dig in progress (MultiPlayerGameMode.stopDestroyBlock).

§dig_change_direction: bool

26.3 MultiPlayerGameMode.continueDestroyBlock: while the same block is dug, a hit on another face sends CHANGE_DESTROY_DIRECTION (player action 1) with the new face; the later player-action ids are shifted by one.

§creative_attack_dig_delay: bool

26.3 MultiPlayerGameMode.attack: an attack in creative sets the 5-tick dig delay, so a held button that reaches a block right after sends only swings until it ran out (oracle: 26.3 held_dig.jsonl.gz, attack_mob_creative).

§sends_punch: bool

The serverbound swing-free punch packet goes out where 1.9+ sends the swing after an attack or a missed click (26.3 Minecraft.startAttack / LocalPlayer.swing path).

§boss_bars: bool

The server can show boss bars (1.9+ boss_bar; crate::hud::Hud::boss_bars).

§sign_editor: SignRules

How the sign editor opens, closes and sends its lines (crate::sign).

§book: BookRules

What the book screen sends and changes in the held stack (crate::book).

§sleep_levels_pitch: bool

1.13+ LivingEntity.tick: a sleeping player’s pitch is set to 0 every tick.

Trait Implementations§

Source§

impl Clone for Capabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Capabilities

Source§

impl Debug for Capabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Capabilities

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Capabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more