Event System
Hook into game events with @EventHandler. Player connections, chat, combat, and more.
← Back to Events
java
com.hypixel.hytale.server.core.event.events.ecs
Fired when a block is placed. ECS event - runs on world thread.
Fields
| Field | Type | Getter |
|---|---|---|
| itemInHand | ItemStack | getItemInHand() |
| targetBlock | Vector3i | getTargetBlock() |
| rotation | RotationTuple | getRotation() |
Example Usage
this.getEventRegistry().registerGlobal(PlaceBlockEvent.class, (event) -> {
Player player = event.getPlayer();
BlockPos pos = event.getBlockPos();
if (isProtectedRegion(pos)) {
event.setCancelled(true);
}
});