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
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final Map
<VillagerProfession, ResourceKey<LootTable>> Deprecated.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
protected boolean
canStillUse
(ServerLevel pLevel, Villager pEntity, long pGameTime) protected boolean
checkExtraStartConditions
(ServerLevel pLevel, Villager pOwner) getItemToThrow
(Villager pVillager) getNearestTargetableHero
(Villager pVillager) private boolean
private boolean
isHeroVisible
(Villager pVillager) private boolean
isWithinThrowingDistance
(Villager pVillager, Player pHero) protected void
start
(ServerLevel pLevel, Villager pEntity, long pGameTime) protected void
stop
(ServerLevel pLevel, Villager pEntity, long pGameTime) private void
throwGift
(Villager pVillager, LivingEntity pHero) protected void
tick
(ServerLevel pLevel, Villager pOwner, long pGameTime) 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
Deprecated.Neo: use thedata map
instead -
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 pDuration)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<Villager>
-
start
-
canStillUse
- Overrides:
canStillUse
in classBehavior<Villager>
-
tick
-
stop
-
throwGift
-
getItemToThrow
-
isHeroVisible
-
getNearestTargetableHero
-
isHero
-
isWithinThrowingDistance
-
calculateTimeUntilNextGift
-
data map
instead