LivingEntityUseBlockEvent
DEPRECATED (forRemoval=true) — This event is deprecated and scheduled for removal. Use
UseBlockEvent(ECS event) instead.
Package:
com.hypixel.hytale.server.core.event.events.entityImplements:IEvent<String>Cancellable: No
Standard event dispatched after a living entity uses (interacts with) a block. This event has been replaced by the ECS-based UseBlockEvent which provides richer context and cancellation support.
Fields / Accessors
Section titled “Fields / Accessors”| Field | Type | Accessor | Mutable | Nullable |
|---|---|---|---|---|
ref | Ref<EntityStore> | getRef() | No | No |
blockType | String | getBlockType() | No | No |
- ref — ECS reference to the entity that used the block.
- blockType — The type identifier of the block that was used.
Fired By
Section titled “Fired By”UseBlockInteraction(line 81) viaeventBus dispatchFor— EventBus dispatch after block use (deprecated).
Listening
Section titled “Listening”getEventRegistry().register(LivingEntityUseBlockEvent.class, event -> { Ref<EntityStore> entityRef = event.getRef(); String blockType = event.getBlockType();
// Handle block use (deprecated -- prefer UseBlockEvent)});Migration
Section titled “Migration”Replace usage with the ECS-based UseBlockEvent:
// Old (deprecated):getEventRegistry().register(LivingEntityUseBlockEvent.class, event -> { ... });
// New (preferred):// Register an EntityEventSystem<EntityStore, UseBlockEvent> instead.// See UseBlockEvent documentation for the ECS event handler pattern.Related Events
Section titled “Related Events”UseBlockEvent— The ECS-based replacement for this event. Provides cancellation support and richer context.BreakBlockEvent— ECS event for block destruction (distinct from block use).PlaceBlockEvent— ECS event for block placement.