Interface GeyserDefineEntitiesEvent

All Superinterfaces:
org.geysermc.event.Event

@Experimental @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 Details

    • entities

      @Experimental 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

      @Experimental 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

      @Experimental void register(CustomEntityDefinition definition)
      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 - if definition was not created via CustomEntityDefinition.of(org.geysermc.geyser.api.util.Identifier)
      IllegalStateException - if the identifier has already been registered
      Since:
      2.11.0