#[non_exhaustive]pub struct TickEvents {Show 14 fields
pub chat: Vec<ChatMessage>,
pub chat_dropped: usize,
pub teleported: bool,
pub teleports: Vec<TeleportEvent>,
pub joined: bool,
pub respawned: bool,
pub died: bool,
pub health_changed: bool,
pub game_mode_changed: bool,
pub inventory: Events,
pub block_updates: Vec<(BlockPos, u32)>,
pub block_updates_dropped: usize,
pub raw: Vec<RawInbound>,
pub raw_dropped: usize,
/* private fields */
}Expand description
What happened since the behaviour’s previous tick.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chat: Vec<ChatMessage>Chat messages in arrival order (only with Interests::CHAT).
chat_dropped: usizeChat messages dropped because too many piled up while the behaviour was not ticking.
teleported: boolThe server teleported / corrected the player.
teleports: Vec<TeleportEvent>Every teleport in arrival order, with the sent pose before it (at most 64 per tick).
joined: boolA join game packet arrived (first join or a proxy server switch).
respawned: boolThe player respawned or changed dimension.
died: boolThe player died (health reached 0).
health_changed: boolHealth, food or saturation changed.
game_mode_changed: boolThe game mode changed.
inventory: EventsInventory / window changes and click results (ghast-inventory).
block_updates: Vec<(BlockPos, u32)>Block changes in arrival order (only with Interests::BLOCK_UPDATES): position and
the version’s raw block state (1.8 id << 4 | meta, 1.16 the global palette id).
The world already holds them when the behaviour ticks.
block_updates_dropped: usizeBlock changes dropped because too many piled up between two behaviour ticks.
raw: Vec<RawInbound>The packets asked for with Behavior::raw_packets, in arrival order (kept while the
behaviour is on hold, like chat).
raw_dropped: usizeRaw packets dropped because more than 4096 piled up between two behaviour ticks.
Implementations§
Source§impl TickEvents
impl TickEvents
Sourcepub fn effects(&self) -> &[EffectEvent]
pub fn effects(&self) -> &[EffectEvent]
Our status effects: every entity_effect / remove_entity_effect for us in arrival
order (a re-application with the same values is an Applied too), and Cleared when a
new player entity drops them (join, respawn). See TickContext::effects.
Sourcepub fn hurt(&self) -> &[Hurt]
pub fn hurt(&self) -> &[Hurt]
We were hurt (1.8 – 1.16.5 the hurt entity statuses for our entity, 26.x its
damage_event), in arrival order.
Sourcepub fn knockback(&self) -> &[Knockback]
pub fn knockback(&self) -> &[Knockback]
The server’s pushes on us, in arrival order: our own entity’s velocity packets (an
attack’s knockback among them) and explosion pushes (at most 64 between two behaviour
ticks). The movement already uses them (TickContext::velocity).
Sourcepub fn deaths(&self) -> &[Death]
pub fn deaths(&self) -> &[Death]
Player deaths the server announced (ours: it sends them only to the dead player), with the killer where the version sends one.
Sourcepub fn entities(&self) -> &[Event]
pub fn entities(&self) -> &[Event]
Entity changes in arrival order (only with Interests::ENTITY_EVENTS and entity
tracking): spawns (a re-spawn with the same id is a Removed then a Spawned),
removals, moves, velocity, statuses, ghast_entity::Event::Hurt (the bot’s own
entity included), metadata, riding, pickups. Kept while the behaviour is on hold, at
most 4096.
Sourcepub fn entities_dropped(&self) -> usize
pub fn entities_dropped(&self) -> usize
Entity events dropped because more than 4096 piled up between two behaviour ticks.
Sourcepub fn item_use(&self) -> &[UseEvent]
pub fn item_use(&self) -> &[UseEvent]
Our item use’s steps in order (at most 64 between two behaviour ticks): started by the
right button’s key handling, finished by the server (entity status 9), released, or
interrupted (see crate::common::UseEvent). A use started and ended in the key
handling after the behaviour’s tick shows up on the next tick, like
TickContext::using_item.
Sourcepub fn cooldowns(&self) -> &[CooldownEvent]
pub fn cooldowns(&self) -> &[CooldownEvent]
Our item cooldowns’ starts (the server’s set_cooldown or our own item use) and ends,
in order (1.9+; at most 64 between two behaviour ticks). See crate::cooldown;
TickContext::item_cooldowns holds them now.
Sourcepub fn hud(&self) -> &[HudEvent]
pub fn hud(&self) -> &[HudEvent]
HUD changes in arrival order (only with Interests::HUD): boss bars, titles, the
action bar, the tab list’s header and footer, and the countdowns running out (see
crate::hud). Kept while the behaviour is on hold, at most 256.
Sourcepub fn hud_dropped(&self) -> usize
pub fn hud_dropped(&self) -> usize
HUD events dropped because more than 256 piled up between two behaviour ticks.
Sourcepub fn tab_completions(&self) -> &[TabCompletion]
pub fn tab_completions(&self) -> &[TabCompletion]
The server’s answers to tab-completion requests (TickContext::tab_complete), in
arrival order (at most 64 between two behaviour ticks).
Sourcepub fn signs(&self) -> &[SignEvent]
pub fn signs(&self) -> &[SignEvent]
The sign editor’s events, in order (crate::sign; the open editor is
crate::TickContext::sign_editor).
Sourcepub fn sleep(&self) -> &[SleepEvent]
pub fn sleep(&self) -> &[SleepEvent]
The player fell asleep or woke up, in order (crate::TickContext::sleeping is the
state now).
Sourcepub fn fishing(&self) -> &[FishingEvent]
pub fn fishing(&self) -> &[FishingEvent]
Our fishing bobber’s changes, in arrival order: cast, bite, bite over, hooked, gone
(with entity tracking; see crate::fishing; crate::TickContext::fishing is the
bobber now). At most 64 between two behaviour ticks.
Trait Implementations§
Source§impl Clone for TickEvents
impl Clone for TickEvents
Source§fn clone(&self) -> TickEvents
fn clone(&self) -> TickEvents
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more