Prefab Events
Package: com.hypixel.hytale.server.core.prefab.event
Events related to prefab (structure template) operations.
PrefabPasteEvent
Section titled “PrefabPasteEvent”Fired when a prefab is being pasted into the world. Cancellable.
Class: com.hypixel.hytale.server.core.prefab.event.PrefabPasteEvent
| Property | Value |
|---|---|
| Extends | CancellableEcsEvent |
| Async | No |
| Cancellable | Yes |
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
prefabId | int | The ID of the prefab being pasted |
pasteStart | boolean | Whether this is the start of the paste operation |
Methods
Section titled “Methods”| Method | Returns | Description |
|---|---|---|
getPrefabId() | int | Returns the prefab ID |
isPasteStart() | boolean | Returns true if this is the start of the paste operation |
When Fired
Section titled “When Fired”Fired when a prefab structure is pasted into the world (world generation, commands, etc.).
PrefabPlaceEntityEvent
Section titled “PrefabPlaceEntityEvent”Fired when an entity is placed as part of a prefab.
Class: com.hypixel.hytale.server.core.prefab.event.PrefabPlaceEntityEvent
| Property | Value |
|---|---|
| Extends | EcsEvent |
| Async | No |
| Cancellable | No |
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
prefabId | int | The ID of the prefab being placed |
holder | Holder<EntityStore> | The holder containing entity data to be placed |
Methods
Section titled “Methods”| Method | Returns | Description |
|---|---|---|
getPrefabId() | int | Returns the prefab ID |
getHolder() | Holder<EntityStore> | Returns the entity store holder (annotated @Nonnull) |
When Fired
Section titled “When Fired”Fired for each entity that is spawned as part of pasting a prefab.