Class GiveGiftToHero
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<Villager>
net.minecraft.world.entity.ai.behavior.GiveGiftToHero
- All Implemented Interfaces:
BehaviorControl<Villager>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.behavior.Behavior
Behavior.Status
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private static final Map
<VillagerProfession, ResourceKey<LootTable>> private static final int
private static final int
private static final float
private static final int
private static final int
private long
private int
Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static int
calculateTimeUntilNextGift
(ServerLevel p_22994_) protected boolean
canStillUse
(ServerLevel p_23026_, Villager p_23027_, long p_23028_) protected boolean
checkExtraStartConditions
(ServerLevel p_23003_, Villager p_23004_) getItemToThrow
(Villager p_23010_) getNearestTargetableHero
(Villager p_23040_) private boolean
private boolean
isHeroVisible
(Villager p_23030_) private boolean
isWithinThrowingDistance
(Villager p_23015_, Player p_23016_) protected void
start
(ServerLevel p_23006_, Villager p_23007_, long p_23008_) protected void
stop
(ServerLevel p_23046_, Villager p_23047_, long p_23048_) private void
throwGift
(Villager p_23012_, LivingEntity p_23013_) protected void
tick
(ServerLevel p_23036_, Villager p_23037_, long p_23038_) Methods inherited from class net.minecraft.world.entity.ai.behavior.Behavior
debugString, doStop, getStatus, hasRequiredMemories, tickOrStop, timedOut, tryStart
-
Field Details
-
THROW_GIFT_AT_DISTANCE
private static final int THROW_GIFT_AT_DISTANCE- See Also:
-
MIN_TIME_BETWEEN_GIFTS
private static final int MIN_TIME_BETWEEN_GIFTS- See Also:
-
MAX_TIME_BETWEEN_GIFTS
private static final int MAX_TIME_BETWEEN_GIFTS- See Also:
-
TIME_TO_DELAY_FOR_HEAD_TO_FINISH_TURNING
private static final int TIME_TO_DELAY_FOR_HEAD_TO_FINISH_TURNING- See Also:
-
GIFTS
-
SPEED_MODIFIER
private static final float SPEED_MODIFIER- See Also:
-
timeUntilNextGift
private int timeUntilNextGift -
giftGivenDuringThisRun
private boolean giftGivenDuringThisRun -
timeSinceStart
private long timeSinceStart
-
-
Constructor Details
-
GiveGiftToHero
public GiveGiftToHero(int p_22992_)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<Villager>
-
start
-
canStillUse
- Overrides:
canStillUse
in classBehavior<Villager>
-
tick
-
stop
-
throwGift
-
getItemToThrow
-
isHeroVisible
-
getNearestTargetableHero
-
isHero
-
isWithinThrowingDistance
-
calculateTimeUntilNextGift
-