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 booleanprivate static final Map<VillagerProfession, ResourceKey<LootTable>> Deprecated.private static final intprivate static final intprivate static final floatprivate static final intprivate static final intprivate longprivate intFields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intprotected booleancanStillUse(ServerLevel pLevel, Villager pEntity, long pGameTime) protected booleancheckExtraStartConditions(ServerLevel pLevel, Villager pOwner) getItemToThrow(Villager pVillager) getNearestTargetableHero(Villager pVillager) private booleanprivate booleanisHeroVisible(Villager pVillager) private booleanisWithinThrowingDistance(Villager pVillager, Player pHero) protected voidstart(ServerLevel pLevel, Villager pEntity, long pGameTime) protected voidstop(ServerLevel pLevel, Villager pEntity, long pGameTime) private voidthrowGift(Villager pVillager, LivingEntity pHero) protected voidtick(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 mapinstead -
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:
checkExtraStartConditionsin classBehavior<Villager>
-
start
-
canStillUse
- Overrides:
canStillUsein classBehavior<Villager>
-
tick
-
stop
-
throwGift
-
getItemToThrow
-
isHeroVisible
-
getNearestTargetableHero
-
isHero
-
isWithinThrowingDistance
-
calculateTimeUntilNextGift
-
data mapinstead