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 Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate intprivate static final intprivate @Nullable ItemStackprivate static final intFields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanStillUse(ServerLevel level, Villager body, long timestamp) booleancheckExtraStartConditions(ServerLevel level, Villager body) private static voidclearHeldItem(Villager body) private static voiddisplayAsHeldItem(Villager body, ItemStack itemStack) private voiddisplayCyclingItems(Villager villager) private voiddisplayFirstItem(Villager villager) private voidfindItemsToDisplay(LivingEntity player, Villager villager) private LivingEntitylookAtTarget(Villager myBody) private booleanvoidstart(ServerLevel level, Villager body, long timestamp) voidstop(ServerLevel level, Villager body, long timestamp) voidtick(ServerLevel level, Villager body, long timestamp) private voidupdateDisplayItems(Villager villager) Methods inherited from class Behavior
debugString, doStop, getRequiredMemories, 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 minDuration, int maxDuration)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<Villager>
-
canStillUse
- Overrides:
canStillUsein classBehavior<Villager>
-
start
-
tick
-
stop
-
findItemsToDisplay
-
displayFirstItem
-
updateDisplayItems
-
playerItemStackMatchesCostOfOffer
-
clearHeldItem
-
displayAsHeldItem
-
lookAtTarget
-
displayCyclingItems
-