Event Catalog
Event Catalog
Section titled “Event Catalog”Complete catalog of all events in the Hytale server, organized by category.
Package Location
Section titled “Package Location”- Base Interfaces:
com.hypixel.hytale.event - Player Events:
com.hypixel.hytale.server.core.event.events.player - ECS Events:
com.hypixel.hytale.server.core.event.events.ecs - Entity Events:
com.hypixel.hytale.server.core.event.events.entity - Permission Events:
com.hypixel.hytale.server.core.event.events.permissions - Lifecycle Events:
com.hypixel.hytale.server.core.event.events
Event Hierarchy
Section titled “Event Hierarchy”IBaseEvent<KeyType>├── IEvent<KeyType> (synchronous)│ ├── PlayerEvent<KeyType>│ ├── PlayerRefEvent<KeyType>│ └── EntityEvent<EntityType, KeyType>│├── IAsyncEvent<KeyType> (asynchronous)│ └── PlayerChatEvent│└── EcsEvent (ECS system events) └── CancellableEcsEvent
ICancellable (mixin)└── ICancellableEcsEvent (mixin for ECS)Player Events
Section titled “Player Events”Connection Lifecycle
Section titled “Connection Lifecycle”| Event | Cancellable | Description |
|---|---|---|
PlayerSetupConnectEvent | Yes | Early connection before entity creation |
PlayerConnectEvent | No | Player connected, entity available |
PlayerReadyEvent | No | Player fully ready to play |
AddPlayerToWorldEvent | No | Player being added to world |
PlayerDisconnectEvent | No | Player disconnecting |
PlayerSetupDisconnectEvent | No | Early disconnection during setup |
DrainPlayerFromWorldEvent | No | Player being removed from world |
PlayerSetupConnectEvent
Section titled “PlayerSetupConnectEvent”public class PlayerSetupConnectEvent implements IEvent<Void>, ICancellable { public String getUsername(); public UUID getUuid(); public Auth getAuth(); public ReferralData getReferralData(); public InetSocketAddress getReferralSource(); public ClientReferral getClientReferral();
// Cancellation public void setCancelled(boolean cancelled); public boolean isCancelled(); public void setReason(String reason);}PlayerConnectEvent
Section titled “PlayerConnectEvent”public class PlayerConnectEvent implements IEvent<Void> { public Holder<EntityStore> getHolder(); public PlayerRef getPlayerRef(); public World getWorld(); public void setWorld(World world);}PlayerDisconnectEvent
Section titled “PlayerDisconnectEvent”public class PlayerDisconnectEvent extends PlayerRefEvent<Void> { public PlayerRef getPlayerRef(); public DisconnectReason getDisconnectReason();}Player Actions
Section titled “Player Actions”| Event | Cancellable | Description |
|---|---|---|
PlayerChatEvent | Yes | Chat message (async) |
PlayerMouseButtonEvent | Yes | Mouse button click |
PlayerMouseMotionEvent | Yes | Mouse movement |
PlayerInteractEvent | Yes | Player interaction (deprecated) |
PlayerCraftEvent | No | Crafting (deprecated) |
PlayerChatEvent
Section titled “PlayerChatEvent”public class PlayerChatEvent implements IAsyncEvent<String>, ICancellable { public PlayerRef getSender(); public Collection<PlayerRef> getTargets(); public void setTargets(Collection<PlayerRef> targets); public String getContent(); public void setContent(String content); public ChatFormatter getFormatter(); public void setFormatter(ChatFormatter formatter);
// Cancellation public void setCancelled(boolean cancelled); public boolean isCancelled();}PlayerMouseButtonEvent
Section titled “PlayerMouseButtonEvent”public class PlayerMouseButtonEvent extends PlayerEvent<Void> implements ICancellable { public PlayerRef getPlayerRef(); public float getClientUseTime(); public ItemStack getItemInHand(); public TargetBlock getTargetBlock(); public TargetEntity getTargetEntity(); public Vector2f getScreenPoint(); public MouseButton getMouseButton();}ECS Events
Section titled “ECS Events”Block Events
Section titled “Block Events”| Event | Cancellable | Description |
|---|---|---|
BreakBlockEvent | Yes | Block being broken |
PlaceBlockEvent | Yes | Block being placed |
DamageBlockEvent | Yes | Block taking damage |
UseBlockEvent.Pre | Yes | Before block usage |
UseBlockEvent.Post | No | After block usage |
BreakBlockEvent
Section titled “BreakBlockEvent”public class BreakBlockEvent extends CancellableEcsEvent { public ItemStack getItemInHand(); public TargetBlock getTargetBlock(); public BlockType getBlockType();
// From CancellableEcsEvent public void setCancelled(boolean cancelled); public boolean isCancelled();}PlaceBlockEvent
Section titled “PlaceBlockEvent”public class PlaceBlockEvent extends CancellableEcsEvent { public ItemStack getItemInHand(); public TargetBlock getTargetBlock(); public byte getRotation(); public void setRotation(byte rotation);}DamageBlockEvent
Section titled “DamageBlockEvent”public class DamageBlockEvent extends CancellableEcsEvent { public ItemStack getItemInHand(); public TargetBlock getTargetBlock(); public BlockType getBlockType(); public float getCurrentDamage(); public float getDamage(); public void setDamage(float damage);}Item Events
Section titled “Item Events”| Event | Cancellable | Description |
|---|---|---|
DropItemEvent.Drop | Yes | Item being dropped |
DropItemEvent.PlayerRequest | Yes | Player drop request |
InteractivelyPickupItemEvent | Yes | Item being picked up |
SwitchActiveSlotEvent | Yes | Active slot changing |
DropItemEvent.Drop
Section titled “DropItemEvent.Drop”public static class Drop extends DropItemEvent { public ItemStack getItemStack(); public float getThrowSpeed(); public void setThrowSpeed(float speed);}SwitchActiveSlotEvent
Section titled “SwitchActiveSlotEvent”public class SwitchActiveSlotEvent extends CancellableEcsEvent { public short getPreviousSlot(); public short getNewSlot(); public String getInventorySectionId(); public boolean isServerRequest();}Crafting Events
Section titled “Crafting Events”| Event | Cancellable | Description |
|---|---|---|
CraftRecipeEvent.Pre | Yes | Before crafting |
CraftRecipeEvent.Post | Yes | After crafting |
CraftRecipeEvent
Section titled “CraftRecipeEvent”public abstract class CraftRecipeEvent extends CancellableEcsEvent { public CraftingRecipe getCraftedRecipe(); public int getQuantity();
public static class Pre extends CraftRecipeEvent { } public static class Post extends CraftRecipeEvent { }}Exploration Events
Section titled “Exploration Events”| Event | Cancellable | Description |
|---|---|---|
DiscoverZoneEvent.Display | Yes | Zone discovery display |
Gameplay Events
Section titled “Gameplay Events”| Event | Cancellable | Description |
|---|---|---|
ChangeGameModeEvent | Yes | Game mode change |
public class ChangeGameModeEvent extends CancellableEcsEvent { public GameMode getGameMode();}Entity Events
Section titled “Entity Events”| Event | Cancellable | Description |
|---|---|---|
EntityRemoveEvent | No | Entity being removed |
LivingEntityInventoryChangeEvent | No | Inventory change |
EntityRemoveEvent
Section titled “EntityRemoveEvent”public class EntityRemoveEvent extends EntityEvent<Entity, String> { public Entity getEntity();}LivingEntityInventoryChangeEvent
Section titled “LivingEntityInventoryChangeEvent”public class LivingEntityInventoryChangeEvent extends EntityEvent<LivingEntity, String> { public LivingEntity getEntity(); public ItemContainer getItemContainer(); public Transaction getTransaction();}Permission Events
Section titled “Permission Events”Player Permission Events
Section titled “Player Permission Events”| Event | Cancellable | Description |
|---|---|---|
PlayerPermissionChangeEvent.PermissionsAdded | No | Permissions granted |
PlayerPermissionChangeEvent.PermissionsRemoved | No | Permissions revoked |
PlayerGroupEvent.Added | No | Added to group |
PlayerGroupEvent.Removed | No | Removed from group |
public static class PermissionsAdded extends PlayerPermissionChangeEvent { public UUID getPlayerUuid(); public Set<String> getAddedPermissions();}
public static class PermissionsRemoved extends PlayerPermissionChangeEvent { public UUID getPlayerUuid(); public Set<String> getRemovedPermissions();}Group Permission Events
Section titled “Group Permission Events”| Event | Cancellable | Description |
|---|---|---|
GroupPermissionChangeEvent.Added | No | Permissions added to group |
GroupPermissionChangeEvent.Removed | No | Permissions removed from group |
public static class Added extends GroupPermissionChangeEvent { public String getGroupName(); public Set<String> getAddedPermissions();}Lifecycle Events
Section titled “Lifecycle Events”| Event | Cancellable | Description |
|---|---|---|
BootEvent | No | Server boot complete |
ShutdownEvent | No | Server shutdown |
ShutdownEvent
Section titled “ShutdownEvent”public class ShutdownEvent implements IEvent<Void> { public static final int DISCONNECT_PLAYERS = -48; public static final int UNBIND_LISTENERS = -40; public static final int SHUTDOWN_WORLDS = -32;}Registering Event Listeners
Section titled “Registering Event Listeners”Synchronous Events
Section titled “Synchronous Events”@Overrideprotected void setup() { getEventRegistry().register(PlayerConnectEvent.class, event -> { PlayerRef player = event.getPlayerRef(); getLogger().info("Player connected: " + player.getUsername()); } );}With Priority
Section titled “With Priority”getEventRegistry().register( EventPriority.EARLY, PlayerChatEvent.class, event -> { // Process early in chain });Cancellable Events
Section titled “Cancellable Events”getEventRegistry().register(BreakBlockEvent.class, event -> { if (isProtectedBlock(event.getTargetBlock())) { event.setCancelled(true); } });Async Events
Section titled “Async Events”getEventRegistry().register(PlayerChatEvent.class, event -> { // Runs on async thread String filtered = filterMessage(event.getContent()); event.setContent(filtered); });Event Summary
Section titled “Event Summary”| Category | Count | Cancellable |
|---|---|---|
| Player Connection | 7 | 1 |
| Player Actions | 5 | 4 |
| Block Events | 5 | 4 |
| Item Events | 4 | 4 |
| Crafting Events | 2 | 2 |
| Exploration Events | 1 | 1 |
| Gameplay Events | 1 | 1 |
| Entity Events | 2 | 0 |
| Permission Events | 6 | 0 |
| Lifecycle Events | 2 | 0 |
| Total | 35 | 17 |
Deprecated Events
Section titled “Deprecated Events”| Event | Replacement |
|---|---|
PlayerInteractEvent | Use ECS events |
PlayerCraftEvent | Use CraftRecipeEvent.Pre/Post |
LivingEntityUseBlockEvent | Use UseBlockEvent |
PrepareUniverseEvent | (none) |
Related
Section titled “Related”- Event System - Event system overview
- Component Catalog - ECS components
- Permission System - Permission events