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 net.minecraft.world.entity.ai.behavior.Behavior
Behavior.Status
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ToIntFunction
<E> private final Function
<E, SoundEvent> private final int
private final int
private final int
private final TargetingConditions
static final int
private final float
Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
ConstructorsConstructorDescriptionPrepareRamNearestTarget
(ToIntFunction<E> pGetCooldownOnFall, int pMinRamDistance, int pMaxRamDistance, float pWalkSpeed, TargetingConditions pRamTargeting, int pRamPrepareTime, Function<E, SoundEvent> pGetPrepareRamSound) -
Method Summary
Modifier and TypeMethodDescriptioncalculateRammingStartPosition
(PathfinderMob pPathfinder, LivingEntity pEntity) protected boolean
canStillUse
(ServerLevel pLevel, PathfinderMob pEntity, long pGameTime) private void
chooseRamPosition
(PathfinderMob pPathfinder, LivingEntity pEntity) private Vec3
getEdgeOfBlock
(BlockPos pPos, BlockPos pOther) private boolean
isWalkableBlock
(PathfinderMob pPathfinder, BlockPos pPos) protected void
start
(ServerLevel pLevel, PathfinderMob pEntity, long pGameTime) protected void
stop
(ServerLevel pLevel, E pEntity, long pGameTime) protected void
tick
(ServerLevel pLevel, E pOwner, long pGameTime) Methods inherited from class net.minecraft.world.entity.ai.behavior.Behavior
checkExtraStartConditions, debugString, doStop, 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> pGetCooldownOnFall, int pMinRamDistance, int pMaxRamDistance, float pWalkSpeed, TargetingConditions pRamTargeting, int pRamPrepareTime, Function<E, SoundEvent> pGetPrepareRamSound)
-
-
Method Details
-
start
- Overrides:
start
in classBehavior<E extends PathfinderMob>
-
stop
- Overrides:
stop
in classBehavior<E extends PathfinderMob>
-
canStillUse
- Overrides:
canStillUse
in classBehavior<E extends PathfinderMob>
-
tick
- Overrides:
tick
in classBehavior<E extends PathfinderMob>
-
getEdgeOfBlock
-
calculateRammingStartPosition
private Optional<BlockPos> calculateRammingStartPosition(PathfinderMob pPathfinder, LivingEntity pEntity) -
isWalkableBlock
-
chooseRamPosition
-