Class GoAndGiveItemsToTarget<E extends LivingEntity>
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.GoAndGiveItemsToTarget<E>
- All Implemented Interfaces:
BehaviorControl<E>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final intprivate final MemoryModuleType<Integer> private final GoAndGiveItemsToTarget.ItemThrower<E> private final floatprivate final Function<LivingEntity, Optional<PositionTracker>> Fields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionGoAndGiveItemsToTarget(Function<LivingEntity, Optional<PositionTracker>> targetPositionGetter, float speedModifier, int timeoutDuration, GoAndGiveItemsToTarget.ItemThrower<E> itemThrower, MemoryModuleType<Integer> cooldownMemory, int cooldownDuration, Predicate<E> hasItemPredicate) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanStillUse(ServerLevel level, E body, long timestamp) private booleancanThrowItemToTarget(E body) protected booleancheckExtraStartConditions(ServerLevel level, E body) protected voidstart(ServerLevel level, E body, long timestamp) protected voidtick(ServerLevel level, E body, long timestamp) Methods inherited from class Behavior
debugString, doStop, getRequiredMemories, getStatus, hasRequiredMemories, stop, tickOrStop, timedOut, tryStart
-
Field Details
-
CLOSE_ENOUGH_DISTANCE_TO_TARGET
private static final int CLOSE_ENOUGH_DISTANCE_TO_TARGET- See Also:
-
targetPositionGetter
-
speedModifier
private final float speedModifier -
itemThrower
-
cooldownMemory
-
cooldownDuration
private final int cooldownDuration -
hasItemPredicate
-
-
Constructor Details
-
GoAndGiveItemsToTarget
public GoAndGiveItemsToTarget(Function<LivingEntity, Optional<PositionTracker>> targetPositionGetter, float speedModifier, int timeoutDuration, GoAndGiveItemsToTarget.ItemThrower<E> itemThrower, MemoryModuleType<Integer> cooldownMemory, int cooldownDuration, Predicate<E> hasItemPredicate)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<E extends LivingEntity>
-
canStillUse
- Overrides:
canStillUsein classBehavior<E extends LivingEntity>
-
start
- Overrides:
startin classBehavior<E extends LivingEntity>
-
tick
- Overrides:
tickin classBehavior<E extends LivingEntity>
-
canThrowItemToTarget
-