Class LongJumpToRandomPos<E extends Mob>

java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.LongJumpToRandomPos<E>
All Implemented Interfaces:
BehaviorControl<E>
Direct Known Subclasses:
LongJumpToPreferredBlock

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

    • FIND_JUMP_TRIES

      protected static final int FIND_JUMP_TRIES
      See Also:
    • PREPARE_JUMP_DURATION

      private static final int PREPARE_JUMP_DURATION
      See Also:
    • MIN_PATHFIND_DISTANCE_TO_VALID_JUMP

      protected static final int MIN_PATHFIND_DISTANCE_TO_VALID_JUMP
      See Also:
    • TIME_OUT_DURATION

      private static final int TIME_OUT_DURATION
      See Also:
    • ALLOWED_ANGLES

      private static final List<Integer> ALLOWED_ANGLES
    • timeBetweenLongJumps

      private final UniformInt timeBetweenLongJumps
    • maxLongJumpHeight

      protected final int maxLongJumpHeight
    • maxLongJumpWidth

      protected final int maxLongJumpWidth
    • maxJumpVelocity

      protected final float maxJumpVelocity
    • jumpCandidates

      protected List<LongJumpToRandomPos.PossibleJump> jumpCandidates
    • initialPosition

      protected Optional<Vec3> initialPosition
    • chosenJump

      @Nullable protected Vec3 chosenJump
    • findJumpTries

      protected int findJumpTries
    • prepareJumpStart

      protected long prepareJumpStart
    • getJumpSound

      private final Function<E extends Mob,SoundEvent> getJumpSound
    • acceptableLandingSpot

      private final BiPredicate<E extends Mob,BlockPos> acceptableLandingSpot
  • Constructor Details

  • Method Details

    • defaultAcceptableLandingSpot

      public static <E extends Mob> boolean defaultAcceptableLandingSpot(E p_251540_, BlockPos p_248879_)
    • 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_, E 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>
    • pickCandidate

      protected void pickCandidate(ServerLevel p_217319_, E p_217320_, long p_217321_)
    • getJumpCandidate

      protected Optional<LongJumpToRandomPos.PossibleJump> getJumpCandidate(ServerLevel p_217299_)
    • isAcceptableLandingPosition

      private boolean isAcceptableLandingPosition(ServerLevel p_217300_, E p_217301_, BlockPos p_217302_)
    • calculateOptimalJumpVector

      @Nullable protected Vec3 calculateOptimalJumpVector(Mob p_217304_, Vec3 p_217305_)
    • calculateJumpVectorForAngle

      @Nullable private Vec3 calculateJumpVectorForAngle(Mob p_217307_, Vec3 p_217308_, int p_217309_)
    • isClearTransition

      private boolean isClearTransition(Mob p_249070_, EntityDimensions p_250156_, Vec3 p_251660_, Vec3 p_250101_)