Interface Locatable

All Known Subinterfaces:
Entity, Player
All Known Implementing Classes:
AbstractCommandBlockActor, AbstractPlayerActor

public interface Locatable
  • Method Summary

    Modifier and Type
    Method
    Description
    default Location
    Get the location of this actor in block coordinates.
    Get the extent that this actor is in.
    Get the location of this actor.
    boolean
    Sets the location of this actor.
    default void
    Deprecated.
    This method may fail without indication.
    default boolean
    Attempts to set the position of this actor.
  • Method Details

    • getLocation

      Location getLocation()
      Get the location of this actor.
      Returns:
      the location of the actor
    • getBlockLocation

      default Location getBlockLocation()
      Get the location of this actor in block coordinates.
      Returns:
      the block location of the actor
    • setLocation

      boolean setLocation(Location location)
      Sets the location of this actor.
      Parameters:
      location - the new location of the actor
      Returns:
      if the teleport succeeded
    • setPosition

      @Deprecated default void setPosition(Vector3 pos)
      Deprecated.
      This method may fail without indication. Use trySetPosition(Vector3) instead
      Sets the position of this actor.
      Parameters:
      pos - where to move them
    • trySetPosition

      default boolean trySetPosition(Vector3 pos)
      Attempts to set the position of this actor.

      This action may fail, due to other mods cancelling the move. If so, this method will return false.

      Parameters:
      pos - the position to set
      Returns:
      if the position was able to be set
    • getExtent

      Extent getExtent()
      Get the extent that this actor is in.
      Returns:
      the extent