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 Vec3
protected static final int
protected int
private final Function
<E, SoundEvent> protected List
<LongJumpToRandomPos.PossibleJump> protected final float
protected final int
protected final int
protected static final int
private static final int
protected long
private static final int
private final UniformInt
Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
ConstructorsConstructorDescriptionLongJumpToRandomPos
(UniformInt timeBetweenLongJumps, int maxLongJumpHeight, int maxLongJumpWidth, float maxJumpVelocity, Function<E, SoundEvent> getJumpSound) LongJumpToRandomPos
(UniformInt timeBetweenLongJumps, int maxLongJumpHeight, int maxLongJumpWidth, float maxJumpVelocity, Function<E, SoundEvent> getJumpSound, BiPredicate<E, BlockPos> acceptableLandingSpot) -
Method Summary
Modifier and TypeMethodDescriptionprotected Vec3
calculateOptimalJumpVector
(Mob mob, Vec3 target) protected boolean
canStillUse
(ServerLevel level, Mob entity, long gameTime) protected boolean
checkExtraStartConditions
(ServerLevel level, Mob owner) static <E extends Mob>
booleandefaultAcceptableLandingSpot
(E mob, BlockPos pos) protected Optional
<LongJumpToRandomPos.PossibleJump> getJumpCandidate
(ServerLevel level) private boolean
isAcceptableLandingPosition
(ServerLevel level, E entity, BlockPos pos) protected void
pickCandidate
(ServerLevel level, E entity, long prepareJumpStart) protected void
start
(ServerLevel level, E entity, long gameTime) protected void
tick
(ServerLevel level, E owner, long gameTime) 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 timeBetweenLongJumps, int maxLongJumpHeight, int maxLongJumpWidth, float maxJumpVelocity, Function<E, SoundEvent> getJumpSound) -
LongJumpToRandomPos
public LongJumpToRandomPos(UniformInt timeBetweenLongJumps, int maxLongJumpHeight, int maxLongJumpWidth, float maxJumpVelocity, Function<E, SoundEvent> getJumpSound, BiPredicate<E, BlockPos> acceptableLandingSpot)
-
-
Method Details
-
defaultAcceptableLandingSpot
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<E extends Mob>
-
canStillUse
- Overrides:
canStillUse
in classBehavior<E extends Mob>
-
start
-
tick
-
pickCandidate
-
getJumpCandidate
-
isAcceptableLandingPosition
-
calculateOptimalJumpVector
-