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 int
private int
private int
private static final int
private ItemStack
private static final int
Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canStillUse
(ServerLevel level, Villager entity, long gameTime) boolean
checkExtraStartConditions
(ServerLevel level, Villager owner) private static void
clearHeldItem
(Villager villager) private static void
displayAsHeldItem
(Villager villager, ItemStack item) private void
displayCyclingItems
(Villager villager) private void
displayFirstItem
(Villager villager) private void
findItemsToDisplay
(LivingEntity entity, Villager villager) private LivingEntity
lookAtTarget
(Villager villager) private boolean
void
start
(ServerLevel level, Villager entity, long gameTime) void
stop
(ServerLevel level, Villager entity, long gameTime) void
tick
(ServerLevel level, Villager owner, long gameTime) private void
updateDisplayItems
(Villager villager) 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 minDuration, int maxDuration)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<Villager>
-
canStillUse
- Overrides:
canStillUse
in classBehavior<Villager>
-
start
-
tick
-
stop
-
findItemsToDisplay
-
displayFirstItem
-
updateDisplayItems
-
playerItemStackMatchesCostOfOffer
-
clearHeldItem
-
displayAsHeldItem
-
lookAtTarget
-
displayCyclingItems
-