net.minecraft.world.entity.npc

public class Villager

extends AbstractVillager implements ReputationEventHandler, VillagerDataHolder

All mapped superinterfaces:

SyncedDataHolder, Nameable, EntityAccess, UniquelyIdentifyable, ScoreHolder, DataComponentGetter, Attackable, WaypointTransmitter, Waypoint, EquipmentUser, Leashable, Targeting, InventoryCarrier, Npc, Merchant, ReputationEventHandler, VillagerDataHolder

cuf
net.minecraft.world.entity.npc.Villager
net.minecraft.class_1646
net.minecraft.entity.passive.VillagerEntity

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
cq
LOGGER
field_36335
LOGGER
private static final EntityDataAccessor<VillagerData>
cr
DATA_VILLAGER_DATA
field_7445
VILLAGER_DATA
public static final int
cm
BREEDING_FOOD_THRESHOLD
field_30602
field_30602
public static final Map<Item, Integer>
cn
FOOD_POINTS
field_18526
ITEM_FOOD_VALUES
private static final int
cs
TRADES_PER_LEVEL
field_30604
field_30604
private static final int
ct
MAX_GOSSIP_TOPICS
field_30605
field_30605
private static final int
cu
GOSSIP_COOLDOWN
field_30606
field_30606
private static final int
cv
GOSSIP_DECAY_INTERVAL
field_30607
field_30607
private static final int
cw
HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS
field_30609
field_30609
private static final int
cx
HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM
field_30610
field_30610
private static final long
cy
TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING
field_30611
field_30611
public static final float
co
SPEED_MODIFIER
field_30603
field_30603
private static final int
cz
DEFAULT_XP
field_57709
field_57709
private static final byte
cA
DEFAULT_FOOD_LEVEL
field_57710
field_57710
private static final int
cB
DEFAULT_LAST_RESTOCK
field_57711
field_57711
private static final int
cC
DEFAULT_LAST_GOSSIP_DECAY
field_57712
field_57712
private static final int
cD
DEFAULT_RESTOCKS_TODAY
field_57713
field_57713
private static final boolean
cE
DEFAULT_ASSIGN_PROFESSION_WHEN_SPAWNED
field_57714
DEFAULT_NATURAL
private int
cF
updateMerchantTimer
field_18528
levelUpTimer
private boolean
cG
increaseProfessionLevelOnUpdate
field_18529
levelingUp
private Player
cH
lastTradedPlayer
field_18530
lastCustomer
private boolean
cI
chasing
field_30612
field_30612
private int
cJ
foodLevel
field_18533
foodLevel
private final GossipContainer
cM
gossips
field_18534
gossip
private long
cN
lastGossipTime
field_18535
gossipStartTime
private long
cO
lastGossipDecayTime
field_19357
lastGossipDecayTime
private int
cP
villagerXp
field_18536
experience
private long
cQ
lastRestockGameTime
field_18537
lastRestockTime
private int
cR
numberOfRestocksToday
field_19427
restocksToday
private long
cS
lastRestockCheckDayTime
field_20332
lastRestockCheckTime
private boolean
cT
assignProfessionWhenSpawned
field_25167
natural
private static final com.google.common.collect.ImmutableList<MemoryModuleType<?>>
cU
MEMORY_TYPES
field_18538
MEMORY_MODULES
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>>
cV
SENSOR_TYPES
field_18539
SENSORS
public static final Map<MemoryModuleType<GlobalPos>, BiPredicate<Villager, Holder<PoiType>>>
cp
POI_MEMORIES
field_18851
POINTS_OF_INTEREST

Constructor summary

ModifierConstructor
public (EntityType<? extends Villager> arg0, Level arg1)
public (EntityType<? extends Villager> entityType, Level world, ResourceKey<VillagerType> type)
public (EntityType<? extends Villager> entityType, Level world, Holder<VillagerType> type)

Method summary

Modifier and TypeMethod
public Brain<Villager>
eh()
getBrain()
method_18868()
getBrain()
protected Brain$Provider<Villager>
ei()
brainProvider()
method_28306()
createBrainProfile()
protected Brain<?>
a(com.mojang.serialization.Dynamic<?> arg0)
makeBrain(com.mojang.serialization.Dynamic<?> arg0)
method_18867(com.mojang.serialization.Dynamic<?> arg0)
deserializeBrain(com.mojang.serialization.Dynamic<?> arg0)
public void
g(aub arg0)
refreshBrain(ServerLevel arg0)
method_19179(class_3218 arg0)
reinitializeBrain(ServerWorld world)
private void
a(cbm<cuf> arg0)
registerBrainGoals(Brain<Villager> arg0)
method_19174(class_4095<class_1646> arg0)
initBrain(Brain<VillagerEntity> brain)
protected void
h()
ageBoundaryReached()
method_5619()
onGrowUp()
public static AttributeSupplier$Builder
gQ()
createAttributes()
method_26955()
createVillagerAttributes()
public boolean
gS()
assignProfessionWhenSpawned()
method_29279()
isNatural()
protected void
a(aub arg0)
customServerAiStep(ServerLevel arg0)
method_5958(class_3218 arg0)
mobTick(ServerWorld arg0)
public void
g()
tick()
method_5773()
tick()
public InteractionResult
b(cut arg0, bxi arg1)
mobInteract(Player arg0, InteractionHand arg1)
method_5992(class_1657 arg0, class_1268 arg1)
interactMob(PlayerEntity arg0, Hand arg1)
private void
hd()
setUnhappy()
method_20264()
sayNo()
private void
j(cut arg0)
startTrading(Player arg0)
method_19191(class_1657 arg0)
beginTradeWith(PlayerEntity customer)
public void
g(cut arg0)
setTradingPlayer(Player arg0)
method_8259(class_1657 arg0)
setCustomer(PlayerEntity arg0)
protected void
gN()
stopTrading()
method_19181()
resetCustomer()
private void
he()
resetSpecialPrices()
method_19187()
clearSpecialPrices()
public boolean
gT()
canRestock()
method_20708()
canRefreshTrades()
public void
gU()
restock()
method_19182()
restock()
private void
hf()
resendOffersToTradingPlayer()
method_49695()
sendOffersToCustomer()
private boolean
hg()
needsToRestock()
method_20823()
needsRestock()
private boolean
hh()
allowedToRestock()
method_20824()
canRestock()
public boolean
gV()
shouldRestock()
method_20822()
shouldRestock()
private void
hi()
catchUpDemand()
method_21723()
restockAndUpdateDemandBonus()
private void
hj()
updateDemand()
method_21724()
updateDemandBonus()
private void
k(cut arg0)
updateSpecialPrices(Player arg0)
method_19192(class_1657 arg0)
prepareOffersFor(PlayerEntity player)
protected void
a(all$a arg0)
defineSynchedData(SynchedEntityData$Builder arg0)
method_5693(class_2945$class_9222 arg0)
initDataTracker(DataTracker$Builder arg0)
public static VillagerData
gW()
createDefaultVillagerData()
method_67359()
createVillagerData()
protected void
a(fdc arg0)
addAdditionalSaveData(ValueOutput arg0)
method_5652(class_11372 arg0)
writeCustomData(WriteView arg0)
protected void
a(fda arg0)
readAdditionalSaveData(ValueInput arg0)
method_5749(class_11368 arg0)
readCustomData(ReadView arg0)
public boolean
h(double arg0)
removeWhenFarAway(double arg0)
method_5974(double arg0)
canImmediatelyDespawn(double arg0)
protected SoundEvent
p()
getAmbientSound()
method_5994()
getAmbientSound()
protected SoundEvent
e(byb arg0)
getHurtSound(DamageSource arg0)
method_6011(class_1282 arg0)
getHurtSound(DamageSource arg0)
protected SoundEvent
f_()
getDeathSound()
method_6002()
getDeathSound()
public void
gX()
playWorkSound()
method_19183()
playWorkSound()
public void
a(cug arg0)
setVillagerData(VillagerData arg0)
method_7195(class_3850 arg0)
setVillagerData(VillagerData arg0)
public VillagerData
gR()
getVillagerData()
method_7231()
getVillagerData()
protected void
b(dlq arg0)
rewardTradeXp(MerchantOffer arg0)
method_18008(class_1914 arg0)
afterUsing(TradeOffer arg0)
public void
a(cam arg0)
setLastHurtByMob(LivingEntity arg0)
method_6015(class_1309 arg0)
setAttacker(LivingEntity arg0)
public void
a(byb arg0)
die(DamageSource arg0)
method_6078(class_1282 arg0)
onDeath(DamageSource arg0)
private void
hk()
releaseAllPois()
method_30958()
releaseAllTickets()
private void
G(bzm arg0)
tellWitnessesThatIWasMurdered(Entity arg0)
method_20690(class_1297 arg0)
notifyDeath(Entity killer)
public void
a(cjo<jk> arg0)
releasePoi(MemoryModuleType<GlobalPos> arg0)
method_19176(class_4140<class_4208> arg0)
releaseTicketFor(MemoryModuleType<GlobalPos> pos)
public boolean
Y_()
canBreed()
method_19184()
isReadyToBreed()
private boolean
hl()
hungry()
method_20698()
canEatFood()
private void
hm()
eatUntilFull()
method_19185()
consumeAvailableFood()
public int
i(cut arg0)
getPlayerReputation(Player arg0)
method_20594(class_1657 arg0)
getReputation(PlayerEntity player)
private void
u(int arg0)
digestFood(int arg0)
method_19193(int arg0)
depleteFood(int amount)
public void
gY()
eatAndDigestFood()
method_20697()
eatForBreeding()
public void
b(dlr arg0)
setOffers(MerchantOffers arg0)
method_16917(class_1916 arg0)
setOffers(TradeOfferList offers)
private boolean
hn()
shouldIncreaseLevel()
method_19188()
canLevelUp()
private void
ho()
increaseMerchantCareer()
method_16918()
levelUp()
protected Component
cD()
getTypeName()
method_23315()
getDefaultName()
public void
b(byte arg0)
handleEntityEvent(byte arg0)
method_5711(byte arg0)
handleStatus(byte arg0)
public SpawnGroupData
a(dnl arg0, bxh arg1, bzu arg2, cbe arg3)
finalizeSpawn(ServerLevelAccessor arg0, DifficultyInstance arg1, EntitySpawnReason arg2, SpawnGroupData arg3)
method_5943(class_5425 arg0, class_1266 arg1, class_3730 arg2, class_1315 arg3)
initialize(ServerWorldAccess arg0, LocalDifficulty arg1, SpawnReason arg2, EntityData arg3)
public Villager
b(aub arg0, bzc arg1)
getBreedOffspring(ServerLevel arg0, AgeableMob arg1)
method_7225(class_3218 arg0, class_1296 arg1)
createChild(ServerWorld arg0, PassiveEntity arg1)
public void
a(aub arg0, cal arg1)
thunderHit(ServerLevel arg0, LightningBolt arg1)
method_5800(class_3218 arg0, class_1538 arg1)
onStruckByLightning(ServerWorld arg0, LightningEntity arg1)
protected void
a(aub arg0, cqz arg1)
pickUpItem(ServerLevel arg0, ItemEntity arg1)
method_5949(class_3218 arg0, class_1542 arg1)
loot(ServerWorld arg0, ItemEntity arg1)
public boolean
c(aub arg0, dcv arg1)
wantsToPickUp(ServerLevel arg0, ItemStack arg1)
method_20820(class_3218 arg0, class_1799 arg1)
canGather(ServerWorld arg0, ItemStack arg1)
public boolean
gZ()
hasExcessFood()
method_7234()
canShareFoodForBreeding()
public boolean
ha()
wantsMoreFood()
method_7239()
needsFoodForBreeding()
private int
hp()
countFoodPointsInInventory()
method_19189()
getAvailableFood()
public boolean
hb()
hasFarmSeeds()
method_19623()
hasSeedToPlant()
protected void
gO()
updateTrades()
method_7237()
fillRecipes()
public void
a(aub arg0, cuf arg1, long arg2)
gossip(ServerLevel arg0, Villager arg1, long arg2)
method_19177(class_3218 arg0, class_1646 arg1, long arg2)
talkWithVillager(ServerWorld world, VillagerEntity villager, long time)
private void
hq()
maybeDecayGossip()
method_20696()
decayGossip()
public void
a(aub arg0, long arg1, int arg2)
spawnGolemIfNeeded(ServerLevel arg0, long arg1, int arg2)
method_20688(class_3218 arg0, long arg1, int arg2)
summonGolem(ServerWorld world, long time, int requiredCount)
public boolean
a(long arg0)
wantsToSpawnGolem(long arg0)
method_20687(long arg0)
canSummonGolem(long time)
public void
a(clm arg0, bzm arg1)
onReputationEventFrom(ReputationEventType arg0, Entity arg1)
method_18870(class_4151 arg0, class_1297 arg1)
onInteractionWith(EntityInteraction arg0, Entity arg1)
public int
t()
getVillagerXp()
method_19269()
getExperience()
public void
t(int arg0)
setVillagerXp(int arg0)
method_19625(int arg0)
setExperience(int experience)
private void
hr()
resetNumberOfRestocks()
method_20821()
clearDailyRestockCount()
public GossipContainer
hc()
getGossips()
method_21651()
getGossip()
public void
a(cjk arg0)
setGossips(GossipContainer arg0)
method_21650(class_4136 arg0)
readGossipData(VillagerGossips gossips)
protected void
ah()
sendDebugPackets()
method_18409()
sendAiDebugData()
public void
b(jb arg0)
startSleeping(BlockPos arg0)
method_18403(class_2338 arg0)
sleep(BlockPos arg0)
public void
fZ()
stopSleeping()
method_18400()
wakeUp()
private boolean
b(long arg0)
golemSpawnConditionsMet(long arg0)
method_20741(long arg0)
hasRecentlySlept(long worldTime)
public <T> T
a(kp<? extends T> arg0)
get(DataComponentType<? extends T> arg0)
method_58694(class_9331<? extends T> arg0)
get(ComponentType<? extends T> arg0)
protected void
a(kl arg0)
applyImplicitComponents(DataComponentGetter arg0)
method_66649(class_9473 arg0)
copyComponentsFrom(ComponentsAccess arg0)
protected <T> boolean
b(kp<T> arg0, T arg1)
applyImplicitComponent(DataComponentType<T> arg0, T arg1)
method_66654(class_9331<T> arg0, T arg1)
setApplicableComponent(ComponentType<T> arg0, T arg1)