Interface Goal

All Known Implementing Classes:
GoalAxis, GoalBlock, GoalComposite, GoalGetToBlock, GoalInverted, GoalNear, GoalRunAway, GoalStrictDirection, GoalTwoBlocks, GoalXZ, GoalYLevel

public interface Goal
An abstract Goal for pathing, can be anything from a specific block to just a Y coordinate.
Author:
leijurv
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    Returns the heuristic at the goal.
    double
    heuristic(int x, int y, int z)
    Estimate the number of ticks it will take to get to the goal
    default double
    heuristic(net.minecraft.core.BlockPos pos)
     
    boolean
    isInGoal(int x, int y, int z)
    Returns whether or not the specified position meets the requirement for this goal based.
    default boolean
    isInGoal(net.minecraft.core.BlockPos pos)
     
  • Method Details

    • isInGoal

      boolean isInGoal(int x, int y, int z)
      Returns whether or not the specified position meets the requirement for this goal based.
      Parameters:
      x - The goal X position
      y - The goal Y position
      z - The goal Z position
      Returns:
      Whether or not it satisfies this goal
    • heuristic

      double heuristic(int x, int y, int z)
      Estimate the number of ticks it will take to get to the goal
      Parameters:
      x - The goal X position
      y - The goal Y position
      z - The goal Z position
      Returns:
      The estimate number of ticks to satisfy the goal
    • isInGoal

      default boolean isInGoal(net.minecraft.core.BlockPos pos)
    • heuristic

      default double heuristic(net.minecraft.core.BlockPos pos)
    • heuristic

      default double heuristic()
      Returns the heuristic at the goal. i.e. heuristic() == heuristic(x,y,z) when isInGoal(x,y,z) == true This is needed by PathingBehavior#estimatedTicksToGoal because some Goals actually do not have a heuristic of 0 when that condition is met
      Returns:
      The estimate number of ticks to satisfy the goal when the goal is already satisfied