net.minecraft.world.entity.npc

public class Villager

extends AbstractVillager implements ReputationEventHandler, VillagerDataHolder

All mapped superinterfaces:

SyncedDataHolder, Nameable, EntityAccess, CommandSource, ScoreHolder, Attackable, EquipmentUser, Targeting, InventoryCarrier, Npc, Merchant, ReputationEventHandler, VillagerDataHolder, VariantHolder

cmm
net.minecraft.world.entity.npc.Villager
net.minecraft.class_1646
net.minecraft.entity.passive.VillagerEntity
net.minecraft.src.C_1118_
net.minecraft.world.entity.npc.EntityVillager

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
ce
LOGGER
field_36335
LOGGER
f_201976_
private static final EntityDataAccessor<VillagerData>
cf
DATA_VILLAGER_DATA
field_7445
VILLAGER_DATA
f_35371_
public static final int
ca
BREEDING_FOOD_THRESHOLD
field_30602
field_30602
f_149997_
public static final Map<Item, Integer>
cb
FOOD_POINTS
field_18526
ITEM_FOOD_VALUES
f_35369_
private static final int
cg
TRADES_PER_LEVEL
field_30604
field_30604
f_149999_
private static final Set<Item>
ch
WANTED_ITEMS
field_18527
GATHERABLE_ITEMS
f_35372_
private static final int
ci
MAX_GOSSIP_TOPICS
field_30605
field_30605
f_150000_
private static final int
cj
GOSSIP_COOLDOWN
field_30606
field_30606
f_150001_
private static final int
ck
GOSSIP_DECAY_INTERVAL
field_30607
field_30607
f_150002_
private static final int
cl
REPUTATION_CHANGE_PER_EVENT
field_30608
field_30608
f_150003_
private static final int
cm
HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS
field_30609
field_30609
f_150004_
private static final int
cn
HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM
field_30610
field_30610
f_150005_
private static final long
co
TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING
field_30611
field_30611
f_150006_
public static final float
cc
SPEED_MODIFIER
field_30603
field_30603
f_149998_
private int
cp
updateMerchantTimer
field_18528
levelUpTimer
f_35373_
private boolean
cq
increaseProfessionLevelOnUpdate
field_18529
levelingUp
f_35374_
private Player
cr
lastTradedPlayer
field_18530
lastCustomer
f_35375_
private boolean
cs
chasing
field_30612
field_30612
f_150007_
private int
ct
foodLevel
field_18533
foodLevel
f_35376_
private final GossipContainer
cu
gossips
field_18534
gossip
f_35377_
private long
cv
lastGossipTime
field_18535
gossipStartTime
f_35378_
private long
cw
lastGossipDecayTime
field_19357
lastGossipDecayTime
f_35361_
private int
cx
villagerXp
field_18536
experience
f_35362_
private long
cz
lastRestockGameTime
field_18537
lastRestockTime
f_35363_
private int
cA
numberOfRestocksToday
field_19427
restocksToday
f_35364_
private long
cB
lastRestockCheckDayTime
field_20332
lastRestockCheckTime
f_35365_
private boolean
cC
assignProfessionWhenSpawned
field_25167
natural
f_35366_
private static final com.google.common.collect.ImmutableList<MemoryModuleType<?>>
cD
MEMORY_TYPES
field_18538
MEMORY_MODULES
f_35367_
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>>
cE
SENSOR_TYPES
field_18539
SENSORS
f_35368_
public static final Map<MemoryModuleType<GlobalPos>, BiPredicate<Villager, Holder<PoiType>>>
cd
POI_MEMORIES
field_18851
POINTS_OF_INTEREST
f_35370_

Constructor summary

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

Method summary

Modifier and TypeMethod
public Brain<Villager>
dS()
getBrain()
method_18868()
getBrain()
m_6274_()
protected Brain$Provider<Villager>
dT()
brainProvider()
method_28306()
createBrainProfile()
m_5490_()
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)
m_8075_(com.mojang.serialization.Dynamic<?> arg0)
public void
c(arf arg0)
refreshBrain(ServerLevel arg0)
method_19179(class_3218 arg0)
reinitializeBrain(ServerWorld world)
m_35483_(C_12_ arg0)
private void
a(but<cmm> arg0)
registerBrainGoals(Brain<Villager> arg0)
method_19174(class_4095<class_1646> arg0)
initBrain(Brain<VillagerEntity> brain)
m_35424_(C_548_<C_1118_> arg0)
protected void
k()
ageBoundaryReached()
method_5619()
onGrowUp()
m_30232_()
public static AttributeSupplier$Builder
gz()
createAttributes()
method_26955()
createVillagerAttributes()
m_35503_()
public boolean
gA()
assignProfessionWhenSpawned()
method_29279()
isNatural()
m_35504_()
protected void
Z()
customServerAiStep()
method_5958()
mobTick()
m_8024_()
public void
l()
tick()
method_5773()
tick()
m_8119_()
public InteractionResult
b(cmz arg0, bqv arg1)
mobInteract(Player arg0, InteractionHand arg1)
method_5992(class_1657 arg0, class_1268 arg1)
interactMob(PlayerEntity arg0, Hand arg1)
m_6071_(C_1141_ p_35473_, C_470_ arg1)
private void
gM()
setUnhappy()
method_20264()
sayNo()
m_35518_()
private void
h(cmz arg0)
startTrading(Player arg0)
method_19191(class_1657 arg0)
beginTradeWith(PlayerEntity customer)
m_35536_(C_1141_ arg0)
public void
f(cmz arg0)
setTradingPlayer(Player arg0)
method_8259(class_1657 arg0)
setCustomer(PlayerEntity arg0)
m_7189_(C_1141_ arg0)
protected void
gw()
stopTrading()
method_19181()
resetCustomer()
m_7996_()
private void
gN()
resetSpecialPrices()
method_19187()
clearSpecialPrices()
m_35519_()
public boolean
gC()
canRestock()
method_20708()
canRefreshTrades()
m_7862_()
public boolean
gy()
isClientSide()
method_38069()
isClient()
m_183595_()
public void
gD()
restock()
method_19182()
restock()
m_35510_()
private void
gO()
resendOffersToTradingPlayer()
method_49695()
sendOffersToCustomer()
m_275846_()
private boolean
gP()
needsToRestock()
method_20823()
needsRestock()
m_35520_()
private boolean
gQ()
allowedToRestock()
method_20824()
canRestock()
m_35521_()
public boolean
gE()
shouldRestock()
method_20822()
shouldRestock()
m_35511_()
private void
gR()
catchUpDemand()
method_21723()
restockAndUpdateDemandBonus()
m_35522_()
private void
gS()
updateDemand()
method_21724()
updateDemandBonus()
m_35523_()
private void
i(cmz arg0)
updateSpecialPrices(Player arg0)
method_19192(class_1657 arg0)
prepareOffersFor(PlayerEntity player)
m_35540_(C_1141_ arg0)
protected void
a(ako$a arg0)
defineSynchedData(SynchedEntityData$Builder arg0)
method_5693(class_2945$class_9222 arg0)
initDataTracker(DataTracker$Builder arg0)
m_8097_(C_5247_$C_313487_ arg0)
public void
b(us arg0)
addAdditionalSaveData(CompoundTag arg0)
method_5652(class_2487 arg0)
writeCustomDataToNbt(NbtCompound arg0)
m_7380_(C_4917_ arg0)
public void
a(us arg0)
readAdditionalSaveData(CompoundTag arg0)
method_5749(class_2487 arg0)
readCustomDataFromNbt(NbtCompound arg0)
m_7378_(C_4917_ arg0)
public boolean
h(double arg0)
removeWhenFarAway(double arg0)
method_5974(double arg0)
canImmediatelyDespawn(double arg0)
m_6785_(double arg0)
protected SoundEvent
v()
getAmbientSound()
method_5994()
getAmbientSound()
m_7515_()
protected SoundEvent
d(brp arg0)
getHurtSound(DamageSource arg0)
method_6011(class_1282 arg0)
getHurtSound(DamageSource arg0)
m_7975_(C_489_ arg0)
protected SoundEvent
o_()
getDeathSound()
method_6002()
getDeathSound()
m_5592_()
public void
gF()
playWorkSound()
method_19183()
playWorkSound()
m_35512_()
public void
a(cmn arg0)
setVillagerData(VillagerData arg0)
method_7195(class_3850 arg0)
setVillagerData(VillagerData arg0)
m_34375_(C_1119_ arg0)
public VillagerData
gB()
getVillagerData()
method_7231()
getVillagerData()
m_7141_()
protected void
b(day arg0)
rewardTradeXp(MerchantOffer arg0)
method_18008(class_1914 arg0)
afterUsing(TradeOffer arg0)
m_8058_(C_1551_ arg0)
public void
x(boolean arg0)
setChasing(boolean arg0)
method_35201(boolean arg0)
method_35201(boolean arg0)
m_150015_(boolean arg0)
public boolean
gG()
isChasing()
method_35200()
method_35200()
m_150014_()
public void
a(btr arg0)
setLastHurtByMob(LivingEntity arg0)
method_6015(class_1309 arg0)
setAttacker(LivingEntity arg0)
m_6703_(C_524_ arg0)
public void
a(brp arg0)
die(DamageSource arg0)
method_6078(class_1282 arg0)
onDeath(DamageSource arg0)
m_6667_(C_489_ arg0)
private void
gT()
releaseAllPois()
method_30958()
releaseAllTickets()
m_35524_()
private void
b(bsw arg0)
tellWitnessesThatIWasMurdered(Entity arg0)
method_20690(class_1297 arg0)
notifyDeath(Entity killer)
m_35420_(C_507_ arg0)
public void
a(ccv<jh> arg0)
releasePoi(MemoryModuleType<GlobalPos> arg0)
method_19176(class_4140<class_4208> arg0)
releaseTicketFor(MemoryModuleType<GlobalPos> pos)
m_35428_(C_753_<C_4697_> arg0)
public boolean
X_()
canBreed()
method_19184()
isReadyToBreed()
m_35506_()
private boolean
gU()
hungry()
method_20698()
lacksFood()
m_35525_()
private void
gV()
eatUntilFull()
method_19185()
consumeAvailableFood()
m_35526_()
public int
g(cmz arg0)
getPlayerReputation(Player arg0)
method_20594(class_1657 arg0)
getReputation(PlayerEntity player)
m_35532_(C_1141_ arg0)
private void
w(int arg0)
digestFood(int arg0)
method_19193(int arg0)
depleteFood(int amount)
m_35548_(int arg0)
public void
gH()
eatAndDigestFood()
method_20697()
eatForBreeding()
m_35513_()
public void
b(daz arg0)
setOffers(MerchantOffers arg0)
method_16917(class_1916 arg0)
setOffers(TradeOfferList offers)
m_35476_(C_1552_ arg0)
private boolean
gW()
shouldIncreaseLevel()
method_19188()
canLevelUp()
m_35527_()
private void
gX()
increaseMerchantCareer()
method_16918()
levelUp()
m_35528_()
protected Component
cr()
getTypeName()
method_23315()
getDefaultName()
m_5677_()
public void
b(byte arg0)
handleEntityEvent(byte arg0)
method_5711(byte arg0)
handleStatus(byte arg0)
m_7822_(byte arg0)
public SpawnGroupData
a(dcp arg0, bqu arg1, btv arg2, buk arg3)
finalizeSpawn(ServerLevelAccessor arg0, DifficultyInstance arg1, MobSpawnType 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)
m_6518_(C_1618_ p_35440_, C_469_ p_35441_, C_529_ p_35442_, C_542_ arg3)
public Villager
b(arf arg0, bsq arg1)
getBreedOffspring(ServerLevel arg0, AgeableMob arg1)
method_7225(class_3218 arg0, class_1296 arg1)
createChild(ServerWorld arg0, PassiveEntity arg1)
m_142606_(C_12_ p_150013_, C_141062_ arg1)
public void
a(arf arg0, btq arg1)
thunderHit(ServerLevel arg0, LightningBolt arg1)
method_5800(class_3218 arg0, class_1538 arg1)
onStruckByLightning(ServerWorld arg0, LightningEntity arg1)
m_8038_(C_12_ p_35410_, C_523_ arg1)
protected void
b(cjj arg0)
pickUpItem(ItemEntity arg0)
method_5949(class_1542 arg0)
loot(ItemEntity arg0)
m_7581_(C_976_ arg0)
public boolean
k(cur arg0)
wantsToPickUp(ItemStack arg0)
method_20820(class_1799 arg0)
canGather(ItemStack arg0)
m_7243_(C_1391_ arg0)
public boolean
gI()
hasExcessFood()
method_7234()
wantsToStartBreeding()
m_35514_()
public boolean
gJ()
wantsMoreFood()
method_7239()
canBreed()
m_35515_()
private int
gY()
countFoodPointsInInventory()
method_19189()
getAvailableFood()
m_35529_()
public boolean
gK()
hasFarmSeeds()
method_19623()
hasSeedToPlant()
m_35516_()
protected void
gx()
updateTrades()
method_7237()
fillRecipes()
m_7604_()
public void
a(arf arg0, cmm 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)
m_35411_(C_12_ p_35413_, C_1118_ p_35414_, long arg2)
private void
gZ()
maybeDecayGossip()
method_20696()
decayGossip()
m_35530_()
public void
a(arf 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)
m_35397_(C_12_ p_35399_, long p_35400_, int arg2)
public boolean
a(long arg0)
wantsToSpawnGolem(long arg0)
method_20687(long arg0)
canSummonGolem(long time)
m_35392_(long arg0)
public void
a(ces arg0, bsw arg1)
onReputationEventFrom(ReputationEventType arg0, Entity arg1)
method_18870(class_4151 arg0, class_1297 arg1)
onInteractionWith(EntityInteraction arg0, Entity arg1)
m_6814_(C_783_ p_35432_, C_507_ arg1)
public int
u()
getVillagerXp()
method_19269()
getExperience()
m_7809_()
public void
v(int arg0)
setVillagerXp(int arg0)
method_19625(int arg0)
setExperience(int experience)
m_35546_(int arg0)
private void
ha()
resetNumberOfRestocks()
method_20821()
clearDailyRestockCount()
m_35531_()
public GossipContainer
gL()
getGossips()
method_21651()
getGossip()
m_35517_()
public void
a(vp arg0)
setGossips(Tag arg0)
method_21650(class_2520 arg0)
readGossipDataNbt(NbtElement nbt)
m_35455_(C_4950_ arg0)
protected void
Y()
sendDebugPackets()
method_18409()
sendAiDebugData()
m_8025_()
public void
b(iz arg0)
startSleeping(BlockPos arg0)
method_18403(class_2338 arg0)
sleep(BlockPos arg0)
m_5802_(C_4675_ arg0)
public void
fM()
stopSleeping()
method_18400()
wakeUp()
m_5796_()
private boolean
b(long arg0)
golemSpawnConditionsMet(long arg0)
method_20741(long arg0)
hasRecentlySlept(long worldTime)
m_35461_(long arg0)