Interface GeyserEntity
- All Known Subinterfaces:
GeyserPlayerEntity
public interface GeyserEntity
Represents a unique instance of an entity. Each
GeyserConnection
have their own sets of entities - no two instances will share the same GeyserEntity instance.-
Method Summary
Modifier and TypeMethodDescription@org.checkerframework.checker.index.qual.NonNegative intjavaId()default voidupdatePropertiesBatched(Consumer<BatchPropertyUpdater> consumer) Updates multiple properties with just one update packet.voidupdatePropertiesBatched(Consumer<BatchPropertyUpdater> consumer, boolean immediate) Updates multiple properties with just one update packet, which can be sent immediately to the client.default <T> voidupdateProperty(@NonNull GeyserEntityProperty<T> property, @Nullable T value) Updates an entity property with a new value.
-
Method Details
-
javaId
@org.checkerframework.checker.index.qual.NonNegative int javaId()- Returns:
- the entity ID that the server has assigned to this entity.
-
updateProperty
Updates an entity property with a new value. If the new value is null, the property is reset to the default value.- Type Parameters:
T- the type of the value- Parameters:
property- aGeyserEntityPropertyregistered for this type in theGeyserDefineEntityPropertiesEventvalue- the new property value- Since:
- 2.9.0
-
updatePropertiesBatched
Updates multiple properties with just one update packet.- Parameters:
consumer- a batch updater- Since:
- 2.9.0
- See Also:
-
updatePropertiesBatched
Updates multiple properties with just one update packet, which can be sent immediately to the client. Usually, sending updates immediately is not required except for specific situations where packet batching would result in update order issues.- Parameters:
consumer- a batch updaterimmediate- whether this update should be sent immediately- Since:
- 2.9.1
- See Also:
-