Class PrepareRamNearestTarget<E extends PathfinderMob>
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.PrepareRamNearestTarget<E>
- All Implemented Interfaces:
BehaviorControl<E>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ToIntFunction<E> private final Function<E, SoundEvent> private final intprivate final intprivate final intprivate final TargetingConditionsstatic final intprivate final floatFields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionPrepareRamNearestTarget(ToIntFunction<E> getCooldownOnFail, int minRamDistance, int maxRamDistance, float walkSpeed, TargetingConditions ramTargeting, int ramPrepareTime, Function<E, SoundEvent> getPrepareRamSound) -
Method Summary
Modifier and TypeMethodDescriptioncalculateRammingStartPosition(PathfinderMob body, LivingEntity ramableTarget) protected booleancanStillUse(ServerLevel level, PathfinderMob body, long timestamp) private voidchooseRamPosition(PathfinderMob body, LivingEntity ramableTarget) private Vec3getEdgeOfBlock(BlockPos startRamPos, BlockPos targetPos) private booleanisWalkableBlock(PathfinderMob body, BlockPos targetPos) protected voidstart(ServerLevel level, PathfinderMob body, long timestamp) protected voidstop(ServerLevel level, E body, long timestamp) protected voidtick(ServerLevel level, E body, long timestamp) Methods inherited from class Behavior
checkExtraStartConditions, debugString, doStop, getRequiredMemories, getStatus, hasRequiredMemories, tickOrStop, timedOut, tryStart
-
Field Details
-
TIME_OUT_DURATION
public static final int TIME_OUT_DURATION- See Also:
-
getCooldownOnFail
-
minRamDistance
private final int minRamDistance -
maxRamDistance
private final int maxRamDistance -
walkSpeed
private final float walkSpeed -
ramTargeting
-
ramPrepareTime
private final int ramPrepareTime -
getPrepareRamSound
-
reachedRamPositionTimestamp
-
ramCandidate
-
-
Constructor Details
-
PrepareRamNearestTarget
public PrepareRamNearestTarget(ToIntFunction<E> getCooldownOnFail, int minRamDistance, int maxRamDistance, float walkSpeed, TargetingConditions ramTargeting, int ramPrepareTime, Function<E, SoundEvent> getPrepareRamSound)
-
-
Method Details
-
start
- Overrides:
startin classBehavior<E extends PathfinderMob>
-
stop
- Overrides:
stopin classBehavior<E extends PathfinderMob>
-
canStillUse
- Overrides:
canStillUsein classBehavior<E extends PathfinderMob>
-
tick
- Overrides:
tickin classBehavior<E extends PathfinderMob>
-
getEdgeOfBlock
-
calculateRammingStartPosition
private Optional<BlockPos> calculateRammingStartPosition(PathfinderMob body, LivingEntity ramableTarget) -
isWalkableBlock
-
chooseRamPosition
-