Class SessionSpawnEntityEvent
java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.bedrock.SessionSpawnEntityEvent
- All Implemented Interfaces:
org.geysermc.event.Cancellable,org.geysermc.event.Event
- Direct Known Subclasses:
ServerAttachParrotsEvent,ServerSpawnEntityEvent
public abstract class SessionSpawnEntityEvent
extends ConnectionEvent
implements org.geysermc.event.Cancellable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @Nullable GeyserEntityDefinitionGets the entity definition sent to the connection when the entity is spawned.abstract voiddefinition(@Nullable GeyserEntityDefinition entityDefinition) Sets the entity definition sent to the connection when the entity is spawned.abstract voidpreSpawnConsumer(Consumer<@NonNull GeyserEntity> consumer) Adds a consumer for theGeyserEntitythat will be called once the entity is created, assuming that it hasn't been cancelled.Methods inherited from class org.geysermc.geyser.api.event.connection.ConnectionEvent
connectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
SessionSpawnEntityEvent
-
-
Method Details
-
definition
Gets the entity definition sent to the connection when the entity is spawned.- Returns:
- the entity definition sent to the connection when the entity is spawned
-
definition
Sets the entity definition sent to the connection when the entity is spawned. This entity definition MUST have been registered in theGeyserDefineEntitiesEventbefore using it here!- Parameters:
entityDefinition- the entity definition sent to the connection when the entity is spawned
-
preSpawnConsumer
Adds a consumer for theGeyserEntitythat will be called once the entity is created, assuming that it hasn't been cancelled. Using this method, you can modify the entities' entity properties, scale, with, and other entity data.- Parameters:
consumer- the consumer for the new GeyserEntity
-