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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.ai.behavior.Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiPredicate<E, BlockPos> protected Vec3protected static final intprotected intprivate final Function<E, SoundEvent> protected List<LongJumpToRandomPos.PossibleJump> protected final floatprotected final intprotected final intprotected static final intprivate static final intprotected longprivate static final intprivate final UniformIntFields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionLongJumpToRandomPos(UniformInt pTimeBetweenLongJumps, int pMaxLongJumpHeight, int pMaxLongJumpWidth, float pMaxJumpVelocity, Function<E, SoundEvent> pGetJumpSound) LongJumpToRandomPos(UniformInt pTimeBetweenLongJumps, int pMaxLongJumpHeight, int pMaxLongJumpWidth, float pMaxJumpVelocity, Function<E, SoundEvent> pGetJumpSound, BiPredicate<E, BlockPos> pAcceptableLandingSpot) -
Method Summary
Modifier and TypeMethodDescriptionprotected Vec3calculateOptimalJumpVector(Mob pMob, Vec3 pTarget) protected booleancanStillUse(ServerLevel p_147653_, Mob p_147654_, long p_147655_) protected booleancheckExtraStartConditions(ServerLevel p_147650_, Mob p_147651_) static <E extends Mob>
booleandefaultAcceptableLandingSpot(E pMob, BlockPos pPos) protected Optional<LongJumpToRandomPos.PossibleJump> getJumpCandidate(ServerLevel pLevel) private booleanisAcceptableLandingPosition(ServerLevel pLevel, E pEntity, BlockPos pPos) protected voidpickCandidate(ServerLevel pLevel, E pEntity, long pPrepareJumpStart) protected voidstart(ServerLevel p_147676_, E p_147677_, long p_147678_) protected voidtick(ServerLevel p_147680_, E p_147681_, long p_147682_) Methods inherited from class net.minecraft.world.entity.ai.behavior.Behavior
debugString, doStop, getStatus, hasRequiredMemories, stop, tickOrStop, timedOut, tryStart
-
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
-
timeBetweenLongJumps
-
maxLongJumpHeight
protected final int maxLongJumpHeight -
maxLongJumpWidth
protected final int maxLongJumpWidth -
maxJumpVelocityMultiplier
protected final float maxJumpVelocityMultiplier -
jumpCandidates
-
initialPosition
-
chosenJump
-
findJumpTries
protected int findJumpTries -
prepareJumpStart
protected long prepareJumpStart -
getJumpSound
-
acceptableLandingSpot
-
-
Constructor Details
-
LongJumpToRandomPos
public LongJumpToRandomPos(UniformInt pTimeBetweenLongJumps, int pMaxLongJumpHeight, int pMaxLongJumpWidth, float pMaxJumpVelocity, Function<E, SoundEvent> pGetJumpSound) -
LongJumpToRandomPos
public LongJumpToRandomPos(UniformInt pTimeBetweenLongJumps, int pMaxLongJumpHeight, int pMaxLongJumpWidth, float pMaxJumpVelocity, Function<E, SoundEvent> pGetJumpSound, BiPredicate<E, BlockPos> pAcceptableLandingSpot)
-
-
Method Details
-
defaultAcceptableLandingSpot
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<E extends Mob>
-
canStillUse
- Overrides:
canStillUsein classBehavior<E extends Mob>
-
start
-
tick
-
pickCandidate
-
getJumpCandidate
-
isAcceptableLandingPosition
-
calculateOptimalJumpVector
-