Class LongJumpToRandomPos<E extends Mob>

java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.LongJumpToRandomPos<E>

public class LongJumpToRandomPos<E extends Mob> extends Behavior<E>
  • Field Details

    • FIND_JUMP_TRIES

      private static final int FIND_JUMP_TRIES
      See Also:
      Constant Field Values
    • PREPARE_JUMP_DURATION

      private static final int PREPARE_JUMP_DURATION
      See Also:
      Constant Field Values
    • MIN_PATHFIND_DISTANCE_TO_VALID_JUMP

      private static final int MIN_PATHFIND_DISTANCE_TO_VALID_JUMP
      See Also:
      Constant Field Values
    • TIME_OUT_DURATION

      public static final int TIME_OUT_DURATION
      See Also:
      Constant Field Values
    • timeBetweenLongJumps

      private final UniformInt timeBetweenLongJumps
    • maxLongJumpHeight

      private final int maxLongJumpHeight
    • maxLongJumpWidth

      private final int maxLongJumpWidth
    • maxJumpVelocity

      private final float maxJumpVelocity
    • jumpCandidates

      private final List<LongJumpToRandomPos.PossibleJump> jumpCandidates
    • initialPosition

      private Optional<Vec3> initialPosition
    • chosenJump

    • findJumpTries

      private int findJumpTries
    • prepareJumpStart

      private long prepareJumpStart
    • getJumpSound

      private Function<E extends Mob,​SoundEvent> getJumpSound
  • Constructor Details

    • LongJumpToRandomPos

      public LongJumpToRandomPos(UniformInt p_147637_, int p_147638_, int p_147639_, float p_147640_, Function<E,​SoundEvent> p_147641_)
  • Method Details

    • checkExtraStartConditions

      protected boolean checkExtraStartConditions(ServerLevel p_147650_, Mob p_147651_)
      Overrides:
      checkExtraStartConditions in class Behavior<E extends Mob>
    • canStillUse

      protected boolean canStillUse(ServerLevel p_147653_, Mob p_147654_, long p_147655_)
      Overrides:
      canStillUse in class Behavior<E extends Mob>
    • start

      protected void start(ServerLevel p_147676_, Mob p_147677_, long p_147678_)
      Overrides:
      start in class Behavior<E extends Mob>
    • tick

      protected void tick(ServerLevel p_147680_, E p_147681_, long p_147682_)
      Overrides:
      tick in class Behavior<E extends Mob>
    • calculateOptimalJumpVector

      private Optional<Vec3> calculateOptimalJumpVector(Mob p_147657_, Vec3 p_147658_)
    • calculateJumpVectorForAngle

      private Optional<Vec3> calculateJumpVectorForAngle(Mob p_147660_, Vec3 p_147661_, int p_147662_)
    • isClearTransition

      private boolean isClearTransition(Mob p_147664_, Vec3 p_147665_, Vec3 p_147666_)