Trait valence::ecs::prelude::Event

pub trait Event: Component { }
Expand description

Something that “happens” and might be read / observed by app logic.

Events can be stored in an Events<E> resource You can conveniently access events using the EventReader and EventWriter system parameter.

Events can also be “triggered” on a World, which will then cause any Observer of that trigger to run.

This trait can be derived.

Events implement the Component type (and they automatically do when they are derived). Events are (generally) not directly inserted as components. More often, the ComponentId is used to identify the event type within the context of the ECS.

Events must be thread-safe.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Event for ChunkLoadEvent
where ChunkLoadEvent: Send + Sync + 'static,

source§

impl Event for ChunkUnloadEvent
where ChunkUnloadEvent: Send + Sync + 'static,

source§

impl Event for CommandExecutionEvent
where CommandExecutionEvent: Send + Sync + 'static,

source§

impl Event for CommandProcessedEvent
where CommandProcessedEvent: Send + Sync + 'static,

source§

impl Event for EquipmentChangeEvent
where EquipmentChangeEvent: Send + Sync + 'static,

source§

impl Event for ClickSlotEvent
where ClickSlotEvent: Send + Sync + 'static,

source§

impl Event for CreativeInventoryActionEvent

source§

impl Event for DropItemStackEvent
where DropItemStackEvent: Send + Sync + 'static,

source§

impl Event for UpdateSelectedSlotEvent
where UpdateSelectedSlotEvent: Send + Sync + 'static,

§

impl Event for HierarchyEvent
where HierarchyEvent: Send + Sync + 'static,

source§

impl<T> Event for CommandResultEvent<T>
where T: Command + Send + Sync + 'static, CommandResultEvent<T>: Send + Sync + 'static,

Implementors§

§

impl Event for AppExit
where AppExit: Send + Sync + 'static,

source§

impl Event for PlayerStartFlyingEvent
where PlayerStartFlyingEvent: Send + Sync + 'static,

source§

impl Event for PlayerStopFlyingEvent
where PlayerStopFlyingEvent: Send + Sync + 'static,

source§

impl Event for DiggingEvent
where DiggingEvent: Send + Sync + 'static,

source§

impl Event for LoadEntityForClientEvent
where LoadEntityForClientEvent: Send + Sync + 'static,

source§

impl Event for UnloadEntityForClientEvent

source§

impl Event for JumpWithHorseEvent
where JumpWithHorseEvent: Send + Sync + 'static,

source§

impl Event for LeaveBedEvent
where LeaveBedEvent: Send + Sync + 'static,

source§

impl Event for SneakEvent
where SneakEvent: Send + Sync + 'static,

source§

impl Event for SprintEvent
where SprintEvent: Send + Sync + 'static,

source§

impl Event for CustomPayloadEvent
where CustomPayloadEvent: Send + Sync + 'static,

source§

impl Event for PacketEvent
where PacketEvent: Send + Sync + 'static,

source§

impl Event for HandSwingEvent
where HandSwingEvent: Send + Sync + 'static,

source§

impl Event for InteractBlockEvent
where InteractBlockEvent: Send + Sync + 'static,

source§

impl Event for InteractEntityEvent
where InteractEntityEvent: Send + Sync + 'static,

source§

impl Event for InteractItemEvent
where InteractItemEvent: Send + Sync + 'static,

source§

impl Event for ChatMessageEvent
where ChatMessageEvent: Send + Sync + 'static,

source§

impl Event for MovementEvent
where MovementEvent: Send + Sync + 'static,

source§

impl Event for AdvancementTabChangeEvent
where AdvancementTabChangeEvent: Send + Sync + 'static,

source§

impl Event for ResourcePackStatusEvent
where ResourcePackStatusEvent: Send + Sync + 'static,

source§

impl Event for RequestRespawnEvent
where RequestRespawnEvent: Send + Sync + 'static,

source§

impl Event for RequestStatsEvent
where RequestStatsEvent: Send + Sync + 'static,

source§

impl Event for StatusEffectAdded
where StatusEffectAdded: Send + Sync + 'static,

source§

impl Event for StatusEffectRemoved
where StatusEffectRemoved: Send + Sync + 'static,

§

impl Event for RemovedComponentEntity
where RemovedComponentEntity: Send + Sync + 'static,

§

impl Event for OnAdd
where OnAdd: Send + Sync + 'static,

§

impl Event for OnInsert
where OnInsert: Send + Sync + 'static,

§

impl Event for OnRemove
where OnRemove: Send + Sync + 'static,