Class PathJobMoveToWithPassable

All Implemented Interfaces:
IPathJob, IDestinationPathJob, Callable<net.minecraft.world.level.pathfinder.Path>

public class PathJobMoveToWithPassable extends PathJobMoveToLocation
Moves to the given location, with a special passable check.
  • Field Details

    • PASSING_COST

      public static final double PASSING_COST
      Additional cost to special passing rule
      See Also:
  • Constructor Details

    • PathJobMoveToWithPassable

      public PathJobMoveToWithPassable(net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos start, @NotNull @NotNull net.minecraft.core.BlockPos end, int range, net.minecraft.world.entity.Mob entity, Function<net.minecraft.world.level.block.state.BlockState,Boolean> isPassable)
      Prepares the PathJob for the path finding system.
      Parameters:
      world - world the entity is in.
      start - starting location.
      end - target location.
      range - max search range.
      entity - the entity.
      isPassable - passable check
  • Method Details

    • isPassable

      protected boolean isPassable(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState block, int x, int y, int z, MNode parent, boolean head)
      Description copied from class: AbstractPathJob
      Is the space passable.
      Overrides:
      isPassable in class AbstractPathJob
      Parameters:
      block - the block we are checking.
      parent - the parent node.
      head - the head position.
      Returns:
      true if the block does not block movement.
    • modifyCost

      protected double modifyCost(double cost, MNode parent, boolean swimstart, boolean swimming, int x, int y, int z, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState below)
      Description copied from class: AbstractPathJob
      Modifies costs if needed for a node
      Overrides:
      modifyCost in class AbstractPathJob
      Returns: