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>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.behavior.Behavior
Behavior.Status
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final int
private final float
private final Function<LivingEntity,
Optional<PositionTracker>> Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
ConstructorDescriptionGoAndGiveItemsToTarget
(Function<LivingEntity, Optional<PositionTracker>> p_217193_, float p_217194_) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canStillUse
(ServerLevel p_217218_, E p_217219_, long p_217220_) private boolean
canThrowItemToTarget
(E p_217203_) protected boolean
checkExtraStartConditions
(ServerLevel p_217196_, E p_217197_) private static Vec3
getThrowPosition
(PositionTracker p_217212_) protected void
start
(ServerLevel p_217199_, E p_217200_, long p_217201_) static void
throwItem
(LivingEntity p_217208_, ItemStack p_217209_, Vec3 p_217210_) protected void
tick
(ServerLevel p_217226_, E p_217227_, long p_217228_) private void
triggerDropItemOnBlock
(PositionTracker p_217214_, ItemStack p_217215_, ServerPlayer p_217216_)
-
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:
-
targetPositionGetter
-
speedModifier
private final float speedModifier
-
-
Constructor Details
-
GoAndGiveItemsToTarget
public GoAndGiveItemsToTarget(Function<LivingEntity, Optional<PositionTracker>> p_217193_, float p_217194_)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<E extends LivingEntity & InventoryCarrier>
-
canStillUse
- Overrides:
canStillUse
in classBehavior<E extends LivingEntity & InventoryCarrier>
-
start
- Overrides:
start
in classBehavior<E extends LivingEntity & InventoryCarrier>
-
tick
- Overrides:
tick
in classBehavior<E extends LivingEntity & InventoryCarrier>
-
triggerDropItemOnBlock
private void triggerDropItemOnBlock(PositionTracker p_217214_, ItemStack p_217215_, ServerPlayer p_217216_) -
canThrowItemToTarget
-
getThrowPosition
-
throwItem
-