Interface PlatformEntity
- All Superinterfaces:
PlatformRegionHolder
- All Known Subinterfaces:
PlatformLivingEntity, PlatformPlayer
Represents an entity in the underlying platform.
This interface provides access to basic entity properties like UUID and location,
as well as integration with the EntityTrackerRegistry.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull PlatformLocationlocation()Returns the current location of the entity.default @NotNull Optional<EntityTrackerRegistry> registry()Retrieves the tracker registry associated with this entity.default @Nullable ModelTaskSchedules a task to run on the next tick, synchronized with this region holder.default @Nullable ModelTaskSchedules a task to run after a delay, synchronized with this region holder.default @NotNull Optional<EntityTracker> Retrieves a specific tracker by name from this entity's registry.@NotNull UUIDuuid()Returns the unique identifier of the entity.
-
Method Details
-
uuid
Returns the unique identifier of the entity.- Returns:
- the UUID
- Since:
- 2.0.0
-
location
Returns the current location of the entity.- Returns:
- the location
- Since:
- 2.0.0
-
task
Description copied from interface:PlatformRegionHolderSchedules a task to run on the next tick, synchronized with this region holder.- Specified by:
taskin interfacePlatformRegionHolder- Parameters:
runnable- the task to run- Returns:
- the scheduled task, or null if scheduling failed
-
taskLater
Description copied from interface:PlatformRegionHolderSchedules a task to run after a delay, synchronized with this region holder.- Specified by:
taskLaterin interfacePlatformRegionHolder- Parameters:
delay- the delay in ticksrunnable- the task to run- Returns:
- the scheduled task, or null if scheduling failed
-
registry
Retrieves the tracker registry associated with this entity.- Returns:
- an optional containing the registry if it exists
- Since:
- 2.0.0
-
tracker
Retrieves a specific tracker by name from this entity's registry.- Parameters:
name- the name of the tracker- Returns:
- an optional containing the tracker if found
- Since:
- 2.0.0
-