Interface EntityNavigation

All Superinterfaces:
SpeedModifier

public interface EntityNavigation extends SpeedModifier
Represents Entity Navigation.

As opposed to the EntityController's movement methods, this type of movement is better for long distances and is easier to manage.

Navigation uses multiple "Nodes" (see Position), which are multiple locations to reach before having an end goal.

  • Method Details

    • recompute

      Deprecated.
      Called automatically by the internal EntityController
      Recomputes this Entity's Path.
      Returns:
      this class, for chaining
    • addPoint

      Adds a Point
      Parameters:
      point - Position to add
      Returns:
      this class, for chaining
    • addPoint

      default EntityNavigation addPoint(@NotNull @NotNull Location point)
      Adds a Point from Location
      Parameters:
      point - Location to add
      Returns:
      this class, for chaining
    • addPoint

      default EntityNavigation addPoint(int x, int y, int z)
      Adds a Point from coordinates
      Parameters:
      x - X coord
      y - Y coord
      z - Z coord
      Returns:
      this class, for chaining
    • addPoint

      default EntityNavigation addPoint(@NotNull @NotNull Entity en)
      Adds a Point from an Entity
      Parameters:
      en - Entity to add
      Returns:
      this class, for chaining
    • addPoint

      EntityNavigation addPoint(int index, @NotNull @NotNull Position point)
      Adds a Point at the given index
      Parameters:
      index - index of point
      point - Position point to add
      Returns:
      this class, for chaining
    • addPoint

      default EntityNavigation addPoint(int index, @NotNull @NotNull Location point)
      Adds a Point at the given index
      Parameters:
      index - index of point
      point - Position point to add
      Returns:
      this class, for chaining
    • addPoint

      default EntityNavigation addPoint(int index, @NotNull @NotNull Entity en)
      Adds a Point at the given index
      Parameters:
      index - index of point
      en - Entity to use as a point
      Returns:
      this class, for chaining
    • removePoint

      Removes a Point
      Parameters:
      point - NavigationPoint to remove
      Returns:
      this class, for chaining
    • removePoint

      EntityNavigation removePoint(int index)
      Removes a Point
      Parameters:
      index - Index of Point
      Returns:
      this class, for chaining
    • removePoint

      default EntityNavigation removePoint(@NotNull @NotNull Location point)
      Removes a Point from Location
      Parameters:
      point - Location to remove
      Returns:
      this class, for chaining
    • removePoint

      default EntityNavigation removePoint(int x, int y, int z)
      Removes a Point from coordinates
      Parameters:
      x - X coord
      y - Y coord
      z - Z coord
      Returns:
      this class, for chaining
    • setRange

      EntityNavigation setRange(int range)
      Sets the maximum range of this Navigation.
      Parameters:
      range - Range of Navigation
      Returns:
      this class, for chaining
    • getRange

      int getRange()
      Fetches the maximum range of this Navigation.
      Returns:
      Range of Navigation
    • buildPath

      Constructs a NavigationPath.
      Returns:
      Constructed NavigationPath
      Throws:
      IllegalArgumentException - if the Path is empty