Class GoAndGiveItemsToTarget<E extends LivingEntity & InventoryCarrier>
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 static final intprivate final GoAndGiveItemsToTarget.ItemThrower<E> private final floatprivate final Function<LivingEntity, Optional<PositionTracker>> private final Vec3Fields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionGoAndGiveItemsToTarget(Function<LivingEntity, Optional<PositionTracker>> targetPositionGetter, float speedModifier, int timeoutDuration, GoAndGiveItemsToTarget.ItemThrower<E> itemThrower) -
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:
-
ITEM_PICKUP_COOLDOWN_AFTER_THROWING
private static final int ITEM_PICKUP_COOLDOWN_AFTER_THROWING- See Also:
-
throwVelocity
-
targetPositionGetter
-
speedModifier
private final float speedModifier -
itemThrower
private final GoAndGiveItemsToTarget.ItemThrower<E extends LivingEntity & InventoryCarrier> itemThrower
-
-
Constructor Details
-
GoAndGiveItemsToTarget
public GoAndGiveItemsToTarget(Function<LivingEntity, Optional<PositionTracker>> targetPositionGetter, float speedModifier, int timeoutDuration, GoAndGiveItemsToTarget.ItemThrower<E> itemThrower)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<E extends LivingEntity & InventoryCarrier>
-
canStillUse
- Overrides:
canStillUsein classBehavior<E extends LivingEntity & InventoryCarrier>
-
start
- Overrides:
startin classBehavior<E extends LivingEntity & InventoryCarrier>
-
tick
- Overrides:
tickin classBehavior<E extends LivingEntity & InventoryCarrier>
-
canThrowItemToTarget
-