Class ShowTradesToPlayer
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<Villager>
net.minecraft.world.entity.ai.behavior.ShowTradesToPlayer
- 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 intprivate intprivate intprivate static final intprivate @Nullable ItemStackprivate static final intFields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanStillUse(ServerLevel p_24109_, Villager p_481859_, long p_24111_) booleancheckExtraStartConditions(ServerLevel p_24106_, Villager p_481544_) private static voidclearHeldItem(Villager pVillager) private static voiddisplayAsHeldItem(Villager pVillager, ItemStack pItem) private voiddisplayCyclingItems(Villager pVillager) private voiddisplayFirstItem(Villager pVillager) private voidfindItemsToDisplay(LivingEntity pTarget, Villager pVillager) private LivingEntitylookAtTarget(Villager pVillager) private booleanvoidstart(ServerLevel p_24124_, Villager p_481725_, long p_24126_) voidstop(ServerLevel p_24144_, Villager p_478501_, long p_24146_) voidtick(ServerLevel p_24134_, Villager p_479720_, long p_24136_) private voidupdateDisplayItems(Villager pVillager) Methods inherited from class net.minecraft.world.entity.ai.behavior.Behavior
debugString, doStop, getStatus, hasRequiredMemories, tickOrStop, timedOut, tryStart
-
Field Details
-
MAX_LOOK_TIME
private static final int MAX_LOOK_TIME- See Also:
-
STARTING_LOOK_TIME
private static final int STARTING_LOOK_TIME- See Also:
-
playerItemStack
-
displayItems
-
cycleCounter
private int cycleCounter -
displayIndex
private int displayIndex -
lookTime
private int lookTime
-
-
Constructor Details
-
ShowTradesToPlayer
public ShowTradesToPlayer(int pMinDuration, int pMaxDuration)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<Villager>
-
canStillUse
- Overrides:
canStillUsein classBehavior<Villager>
-
start
-
tick
-
stop
-
findItemsToDisplay
-
displayFirstItem
-
updateDisplayItems
-
playerItemStackMatchesCostOfOffer
-
clearHeldItem
-
displayAsHeldItem
-
lookAtTarget
-
displayCyclingItems
-