Interface GeyserDefineEntitiesEvent
- All Superinterfaces:
org.geysermc.event.Event
@NonExtendable
public interface GeyserDefineEntitiesEvent
extends org.geysermc.event.Event
Called once during Geyser startup to allow users to register custom Bedrock entity types.
All CustomEntityDefinition's must be registered in this event before being used!
To register a custom entity, create a definition with CustomEntityDefinition.of(Identifier)
and pass it to register(CustomEntityDefinition). Additional Bedrock entity properties
can be registered in the subsequent GeyserDefineEntityPropertiesEvent.
- Since:
- 2.11.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns an immutable view of all custom entity definitions registered so far.entities()Returns an immutable view of all currently registered Bedrock entity definitions, including both vanilla and any custom definitions registered so far in this event.voidregister(CustomEntityDefinition definition) Registers a custom entity definition.
-
Method Details
-
entities
Collection<GeyserEntityDefinition> entities()Returns an immutable view of all currently registered Bedrock entity definitions, including both vanilla and any custom definitions registered so far in this event.- Returns:
- immutable collection of all registered entity definitions
- Since:
- 2.11.0
-
customEntities
Collection<CustomEntityDefinition> customEntities()Returns an immutable view of all custom entity definitions registered so far.- Returns:
- immutable collection of registered custom entity definitions
- Since:
- 2.11.0
-
register
Registers a custom entity definition. Using the same identifier twice in different definitions or providing a definition in the vanilla namespace will throw an exception.- Parameters:
definition- the custom entity definition to register; must not be null- Throws:
IllegalArgumentException- ifdefinitionwas not created viaCustomEntityDefinition.of(org.geysermc.geyser.api.util.Identifier)IllegalStateException- if the identifier has already been registered- Since:
- 2.11.0
-