Interface EntityController


public interface EntityController
Represents an Entity Controller, used for calling direct actions for an entity.

For long-term paths in movement, it is recommended to use EntityNavigation.

  • Method Details

    • jump

      Forces this Entity to jump naturally.
      Returns:
      this controller, for chaining
    • lookAt

      Makes this Entity look at another entity.
      Parameters:
      en - Entity to look at
      Returns:
      this controller, for chaining
    • lookAt

      Makes this Entity look at a Location.
      Parameters:
      loc - Location to look at
      Returns:
      this controller, for chaining
    • lookAt

      EntityController lookAt(double x, double y, double z)
      Makes this Entity look at coordinates.
      Parameters:
      x - X coord
      y - Y coord
      z - Z coord
      Returns:
      this controller, for chaining
    • moveTo

      Moves an Entity to another Entity, with no speed modifier.
      Parameters:
      en - Entity to move to
      Returns:
      this controller, for chaining
    • moveTo

      default EntityController moveTo(@NotNull @NotNull Entity en, double speedMod)
      Moves an Entity to another Entity.
      Parameters:
      en - Entity to move to
      speedMod - Speed Modifier
      Returns:
      this controller, for chaining
    • moveTo

      Moves an Entity to the specified Location, with no speed modifier.
      Parameters:
      loc - Location to move to
      Returns:
      this controller, for chaining
    • moveTo

      default EntityController moveTo(@NotNull @NotNull Location loc, double speedMod)
      Moves an Entity to the specified Location.
      Parameters:
      loc - Location to move to
      speedMod - Speed Modifier
      Returns:
      this controller, for chaining
    • moveTo

      default EntityController moveTo(double x, double y, double z)
      Moves an Entity to the specified coordinates, with no speed modifier.
      Parameters:
      x - X coord
      y - Y coord
      z - Z coord
      Returns:
      this controller, for chaining
    • moveTo

      EntityController moveTo(double x, double y, double z, double speedMod)
      Moves an Entity to the specified coordinates.
      Parameters:
      x - X coord
      y - Y coord
      z - Z coord
      speedMod - Speed Modifier
      Returns:
      this controller, for chaining
    • naturalMoveTo

      EntityController naturalMoveTo(double x, double y, double z, NaturalMoveType type)

      Performs a Natural Entity Movement.

      The X, Y, and Z are relative to the entity's current location.

      Example: naturalMoveTo(1, 0, 3, NaturalMoveType.SELF) is a natural movement by the entity's self +1 X-Axis step and +3 Z-Axis steps.

      Parameters:
      x - Relative X to move by
      y - Relative Y to move by
      z - Relative Z to move by
      type - Natural Movement Type
      Returns:
      this controller, for chaining
    • strafe

      EntityController strafe(float fwd, float right)
      Makes this Entity strafe.
      Parameters:
      fwd - Amount to strafe forwards (negative for backwards)
      right - Amount to strafe right (negative for left)
      Returns:
      this controller, for chaining
    • getCurrentSpeedModifier

      double getCurrentSpeedModifier()
      Get the current Speed Modifier that this Entity has, if it is moving.
      Returns:
      Current Speed Modifier
    • getTargetMoveLocation

      Location getTargetMoveLocation()
      Get the Location that this Entity is trying to move towards.
      Returns:
      Target Move Location
    • getTargetLookLocation

      Location getTargetLookLocation()
      Get the Location that this Entity is trying to look at.
      Returns:
      Target Look Location
    • isLookingAtTarget

      boolean isLookingAtTarget()
      Whether this Mob is looking at the last Look Target.
      Returns:
      true if looking, else false
    • getDeltaMovement

      @NotNull @NotNull Vector getDeltaMovement()
      Gets the Delta Movement of this Entity.
      Returns:
      Delta Movement
    • setDeltaMovement

      void setDeltaMovement(@NotNull @NotNull Vector delta)
      Sets the Delta Movement of this Entity.

      Delta Movement is a vector representing the current motion of an entity. You can use it to manually change the direction of motion for an entity without calculating for any collisions.

      Parameters:
      delta - Delta Movement
    • setDeltaMovement

      default void setDeltaMovement(double x, double y, double z)
      Sets the Delta Movement of this Entity.
      Parameters:
      x - Δx
      y - ΔY
      z - ΔZ
    • getDeltaMovementX

      default double getDeltaMovementX()
      Gets the ΔX of this Entity.
      Returns:
      ΔX
    • setDeltaMovementX

      default void setDeltaMovementX(double x)
      Sets the ΔX of this Entity.
      Parameters:
      x - New ΔX
    • getDeltaMovementY

      default double getDeltaMovementY()
      Gets the ΔY of this Entity.
      Returns:
      ΔY
    • setDeltaMovementY

      default void setDeltaMovementY(double y)
      Sets the ΔY of this Entity.
      Parameters:
      y - New ΔY
    • getDeltaMovementZ

      default double getDeltaMovementZ()
      Gets the ΔZ of this Entity.
      Returns:
      ΔZ
    • setDeltaMovementZ

      default void setDeltaMovementZ(double z)
      Sets the ΔZ of this Entity.
      Parameters:
      z - New ΔZ