Entity Events
Package: com.hypixel.hytale.server.core.event.events.entity
Events related to entity lifecycle and state changes.
EntityEvent (Abstract Base)
Section titled “EntityEvent (Abstract Base)”Abstract base class for entity events with generic type parameters.
Class: com.hypixel.hytale.server.core.event.events.entity.EntityEvent<EntityType extends Entity, KeyType>
| Property | Value |
|---|---|
| Implements | IEvent<KeyType> |
| Abstract | Yes |
Type Parameters
Section titled “Type Parameters”EntityType extends Entity- The type of entity this event relates toKeyType- The event key type for filtering
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getEntity() | EntityType | Returns the entity associated with this event |
EntityRemoveEvent
Section titled “EntityRemoveEvent”Fired when an entity is being removed from the world.
Class: com.hypixel.hytale.server.core.event.events.entity.EntityRemoveEvent
| Property | Value |
|---|---|
| Extends | EntityEvent<Entity, String> |
| KeyType | String |
| Async | No |
| Cancellable | No |
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getEntity() | Entity | Returns the entity being removed (inherited) |
When Fired
Section titled “When Fired”Fired when an entity is about to be removed from the world (death, despawn, etc.).
LivingEntityUseBlockEvent (Deprecated)
Section titled “LivingEntityUseBlockEvent (Deprecated)”Fired when a living entity uses/interacts with a block.
Class: com.hypixel.hytale.server.core.event.events.entity.LivingEntityUseBlockEvent
| Property | Value |
|---|---|
| Implements | IEvent<String> |
| Deprecated | Yes (for removal) |
| Async | No |
| Cancellable | No |
| KeyType | String (block type identifier) |
Warning: This event is deprecated and marked for removal in a future version.
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getBlockType() | String | Returns the block type identifier |
getRef() | Ref<EntityStore> | Returns the entity reference |
When Fired
Section titled “When Fired”Fired when a living entity (player, NPC, mob) interacts with a block. Keyed by block type identifier, so you can listen for specific block types.
LivingEntityInventoryChangeEvent
Section titled “LivingEntityInventoryChangeEvent”Fired after any inventory section changes — items added, removed, or moved. This event is not cancellable (notification only). For cancellable item actions, see DropItemEvent and SwitchActiveSlotEvent. See Player Inventory for the inventory API.
Class: com.hypixel.hytale.server.core.event.events.entity.LivingEntityInventoryChangeEvent
| Property | Value |
|---|---|
| Extends | EntityEvent<LivingEntity, String> |
| KeyType | String (world name) |
| Async | No |
| Cancellable | No |
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getEntity() | LivingEntity | The entity whose inventory changed (inherited) |
getItemContainer() | ItemContainer | The section that changed |
getTransaction() | Transaction | What changed (slot, before/after state) |
ItemContainerChangeEvent
Section titled “ItemContainerChangeEvent”Fired when any ItemContainer’s contents change — works for both player inventory sections and window containers. This is a per-container event (keyed by Void, dispatched on the container’s own event bus), unlike LivingEntityInventoryChangeEvent which fires on the global bus.
Class: com.hypixel.hytale.server.core.inventory.container.ItemContainer.ItemContainerChangeEvent
| Property | Value |
|---|---|
| Type | record |
| Implements | IEvent<Void> |
| Async | No |
| Cancellable | No |
| KeyType | Void |
Record Components
Section titled “Record Components”| Component | Type | Description |
|---|---|---|
container | ItemContainer | The container that changed |
transaction | Transaction | What changed (slot, before/after state) |