Interface PlatformEntity

All Superinterfaces:
PlatformRegionHolder
All Known Subinterfaces:
PlatformLivingEntity, PlatformPlayer

public interface PlatformEntity extends PlatformRegionHolder
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 Type
    Method
    Description
    Returns the current location of the entity.
    Retrieves the tracker registry associated with this entity.
    default @Nullable ModelTask
    task(@NotNull Runnable runnable)
    Schedules a task to run on the next tick, synchronized with this region holder.
    default @Nullable ModelTask
    taskLater(long delay, @NotNull Runnable runnable)
    Schedules a task to run after a delay, synchronized with this region holder.
    default @NotNull Optional<EntityTracker>
    tracker(@NotNull String name)
    Retrieves a specific tracker by name from this entity's registry.
    @NotNull UUID
    Returns the unique identifier of the entity.
  • Method Details

    • uuid

      @NotNull @NotNull UUID uuid()
      Returns the unique identifier of the entity.
      Returns:
      the UUID
      Since:
      2.0.0
    • location

      @NotNull @NotNull PlatformLocation location()
      Returns the current location of the entity.
      Returns:
      the location
      Since:
      2.0.0
    • task

      @Nullable default @Nullable ModelTask task(@NotNull @NotNull Runnable runnable)
      Description copied from interface: PlatformRegionHolder
      Schedules a task to run on the next tick, synchronized with this region holder.
      Specified by:
      task in interface PlatformRegionHolder
      Parameters:
      runnable - the task to run
      Returns:
      the scheduled task, or null if scheduling failed
    • taskLater

      @Nullable default @Nullable ModelTask taskLater(long delay, @NotNull @NotNull Runnable runnable)
      Description copied from interface: PlatformRegionHolder
      Schedules a task to run after a delay, synchronized with this region holder.
      Specified by:
      taskLater in interface PlatformRegionHolder
      Parameters:
      delay - the delay in ticks
      runnable - the task to run
      Returns:
      the scheduled task, or null if scheduling failed
    • registry

      @NotNull default @NotNull Optional<EntityTrackerRegistry> registry()
      Retrieves the tracker registry associated with this entity.
      Returns:
      an optional containing the registry if it exists
      Since:
      2.0.0
    • tracker

      @NotNull default @NotNull Optional<EntityTracker> tracker(@NotNull @NotNull String name)
      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