net.minecraft.world.entity.npc

public class Villager

extends AbstractVillager implements ReputationEventHandler, VillagerDataHolder

All mapped superinterfaces:

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

cpj
net.minecraft.world.entity.npc.Villager
net.minecraft.class_1646
net.minecraft.entity.passive.VillagerEntity
net.minecraft.world.entity.npc.EntityVillager

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
cf
LOGGER
field_36335
LOGGER
private static final EntityDataAccessor<VillagerData>
cg
DATA_VILLAGER_DATA
field_7445
VILLAGER_DATA
public static final int
cb
BREEDING_FOOD_THRESHOLD
field_30602
field_30602
public static final Map<Item, Integer>
cc
FOOD_POINTS
field_18526
ITEM_FOOD_VALUES
private static final int
ch
TRADES_PER_LEVEL
field_30604
field_30604
private static final int
ci
MAX_GOSSIP_TOPICS
field_30605
field_30605
private static final int
cj
GOSSIP_COOLDOWN
field_30606
field_30606
private static final int
ck
GOSSIP_DECAY_INTERVAL
field_30607
field_30607
private static final int
cl
HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS
field_30609
field_30609
private static final int
cm
HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM
field_30610
field_30610
private static final long
cn
TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING
field_30611
field_30611
public static final float
cd
SPEED_MODIFIER
field_30603
field_30603
private int
co
updateMerchantTimer
field_18528
levelUpTimer
private boolean
cp
increaseProfessionLevelOnUpdate
field_18529
levelingUp
private Player
cq
lastTradedPlayer
field_18530
lastCustomer
private boolean
cr
chasing
field_30612
field_30612
private int
cs
foodLevel
field_18533
foodLevel
private final GossipContainer
ct
gossips
field_18534
gossip
private long
cu
lastGossipTime
field_18535
gossipStartTime
private long
cv
lastGossipDecayTime
field_19357
lastGossipDecayTime
private int
cw
villagerXp
field_18536
experience
private long
cx
lastRestockGameTime
field_18537
lastRestockTime
private int
cy
numberOfRestocksToday
field_19427
restocksToday
private long
cz
lastRestockCheckDayTime
field_20332
lastRestockCheckTime
private boolean
cC
assignProfessionWhenSpawned
field_25167
natural
private static final com.google.common.collect.ImmutableList<MemoryModuleType<?>>
cD
MEMORY_TYPES
field_18538
MEMORY_MODULES
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>>
cE
SENSOR_TYPES
field_18539
SENSORS
public static final Map<MemoryModuleType<GlobalPos>, BiPredicate<Villager, Holder<PoiType>>>
ce
POI_MEMORIES
field_18851
POINTS_OF_INTEREST

Constructor summary

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

Method summary

Modifier and TypeMethod
public Brain<Villager>
ec()
getBrain()
method_18868()
getBrain()
protected Brain$Provider<Villager>
ed()
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(ash arg0)
refreshBrain(ServerLevel arg0)
method_19179(class_3218 arg0)
reinitializeBrain(ServerWorld world)
private void
a(bxi<cpj> arg0)
registerBrainGoals(Brain<Villager> arg0)
method_19174(class_4095<class_1646> arg0)
initBrain(Brain<VillagerEntity> brain)
protected void
i()
ageBoundaryReached()
method_5619()
onGrowUp()
public static AttributeSupplier$Builder
gx()
createAttributes()
method_26955()
createVillagerAttributes()
public boolean
gz()
assignProfessionWhenSpawned()
method_29279()
isNatural()
protected void
a(ash arg0)
customServerAiStep(ServerLevel arg0)
method_5958(class_3218 arg0)
mobTick(ServerWorld arg0)
public void
h()
tick()
method_5773()
tick()
public InteractionResult
b(cpx arg0, bti arg1)
mobInteract(Player arg0, InteractionHand arg1)
method_5992(class_1657 arg0, class_1268 arg1)
interactMob(PlayerEntity arg0, Hand arg1)
private void
gJ()
setUnhappy()
method_20264()
sayNo()
private void
g(cpx arg0)
startTrading(Player arg0)
method_19191(class_1657 arg0)
beginTradeWith(PlayerEntity customer)
public void
a(cpx arg0)
setTradingPlayer(Player arg0)
method_8259(class_1657 arg0)
setCustomer(PlayerEntity arg0)
protected void
gu()
stopTrading()
method_19181()
resetCustomer()
private void
gK()
resetSpecialPrices()
method_19187()
clearSpecialPrices()
public boolean
gA()
canRestock()
method_20708()
canRefreshTrades()
public void
gB()
restock()
method_19182()
restock()
private void
gL()
resendOffersToTradingPlayer()
method_49695()
sendOffersToCustomer()
private boolean
gM()
needsToRestock()
method_20823()
needsRestock()
private boolean
gN()
allowedToRestock()
method_20824()
canRestock()
public boolean
gC()
shouldRestock()
method_20822()
shouldRestock()
private void
gO()
catchUpDemand()
method_21723()
restockAndUpdateDemandBonus()
private void
gP()
updateDemand()
method_21724()
updateDemandBonus()
private void
h(cpx arg0)
updateSpecialPrices(Player arg0)
method_19192(class_1657 arg0)
prepareOffersFor(PlayerEntity player)
protected void
a(alg$a arg0)
defineSynchedData(SynchedEntityData$Builder arg0)
method_5693(class_2945$class_9222 arg0)
initDataTracker(DataTracker$Builder arg0)
public void
b(ux arg0)
addAdditionalSaveData(CompoundTag arg0)
method_5652(class_2487 arg0)
writeCustomDataToNbt(NbtCompound arg0)
public void
a(ux arg0)
readAdditionalSaveData(CompoundTag arg0)
method_5749(class_2487 arg0)
readCustomDataFromNbt(NbtCompound arg0)
public boolean
h(double arg0)
removeWhenFarAway(double arg0)
method_5974(double arg0)
canImmediatelyDespawn(double arg0)
protected SoundEvent
u()
getAmbientSound()
method_5994()
getAmbientSound()
protected SoundEvent
e(bua arg0)
getHurtSound(DamageSource arg0)
method_6011(class_1282 arg0)
getHurtSound(DamageSource arg0)
protected SoundEvent
o_()
getDeathSound()
method_6002()
getDeathSound()
public void
gD()
playWorkSound()
method_19183()
playWorkSound()
public void
a(cpk arg0)
setVillagerData(VillagerData arg0)
method_7195(class_3850 arg0)
setVillagerData(VillagerData arg0)
public VillagerData
gy()
getVillagerData()
method_7231()
getVillagerData()
protected void
b(dgf arg0)
rewardTradeXp(MerchantOffer arg0)
method_18008(class_1914 arg0)
afterUsing(TradeOffer arg0)
public void
a(bwg arg0)
setLastHurtByMob(LivingEntity arg0)
method_6015(class_1309 arg0)
setAttacker(LivingEntity arg0)
public void
a(bua arg0)
die(DamageSource arg0)
method_6078(class_1282 arg0)
onDeath(DamageSource arg0)
private void
gQ()
releaseAllPois()
method_30958()
releaseAllTickets()
private void
b(bvk arg0)
tellWitnessesThatIWasMurdered(Entity arg0)
method_20690(class_1297 arg0)
notifyDeath(Entity killer)
public void
a(cfk<jp> 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
gR()
hungry()
method_20698()
lacksFood()
private void
gS()
eatUntilFull()
method_19185()
consumeAvailableFood()
public int
f(cpx 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
gE()
eatAndDigestFood()
method_20697()
eatForBreeding()
public void
b(dgg arg0)
setOffers(MerchantOffers arg0)
method_16917(class_1916 arg0)
setOffers(TradeOfferList offers)
private boolean
gT()
shouldIncreaseLevel()
method_19188()
canLevelUp()
private void
gU()
increaseMerchantCareer()
method_16918()
levelUp()
protected Component
cz()
getTypeName()
method_23315()
getDefaultName()
public void
b(byte arg0)
handleEntityEvent(byte arg0)
method_5711(byte arg0)
handleStatus(byte arg0)
public SpawnGroupData
a(dhz arg0, bth arg1, bvq arg2, bwz 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(ash arg0, bvb arg1)
getBreedOffspring(ServerLevel arg0, AgeableMob arg1)
method_7225(class_3218 arg0, class_1296 arg1)
createChild(ServerWorld arg0, PassiveEntity arg1)
public void
a(ash arg0, bwf arg1)
thunderHit(ServerLevel arg0, LightningBolt arg1)
method_5800(class_3218 arg0, class_1538 arg1)
onStruckByLightning(ServerWorld arg0, LightningEntity arg1)
protected void
a(ash arg0, cmb arg1)
pickUpItem(ServerLevel arg0, ItemEntity arg1)
method_5949(class_3218 arg0, class_1542 arg1)
loot(ServerWorld arg0, ItemEntity arg1)
public boolean
c(ash arg0, cxp arg1)
wantsToPickUp(ServerLevel arg0, ItemStack arg1)
method_20820(class_3218 arg0, class_1799 arg1)
canGather(ServerWorld arg0, ItemStack arg1)
public boolean
gF()
hasExcessFood()
method_7234()
wantsToStartBreeding()
public boolean
gG()
wantsMoreFood()
method_7239()
canBreed()
private int
gV()
countFoodPointsInInventory()
method_19189()
getAvailableFood()
public boolean
gH()
hasFarmSeeds()
method_19623()
hasSeedToPlant()
protected void
gv()
updateTrades()
method_7237()
fillRecipes()
public void
a(ash arg0, cpj 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
gW()
maybeDecayGossip()
method_20696()
decayGossip()
public void
a(ash 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(chh arg0, bvk arg1)
onReputationEventFrom(ReputationEventType arg0, Entity arg1)
method_18870(class_4151 arg0, class_1297 arg1)
onInteractionWith(EntityInteraction arg0, Entity arg1)
public int
x()
getVillagerXp()
method_19269()
getExperience()
public void
t(int arg0)
setVillagerXp(int arg0)
method_19625(int arg0)
setExperience(int experience)
private void
gX()
resetNumberOfRestocks()
method_20821()
clearDailyRestockCount()
public GossipContainer
gI()
getGossips()
method_21651()
getGossip()
public void
a(vu arg0)
setGossips(Tag arg0)
method_21650(class_2520 arg0)
readGossipDataNbt(NbtElement nbt)
protected void
Y()
sendDebugPackets()
method_18409()
sendAiDebugData()
public void
b(jh arg0)
startSleeping(BlockPos arg0)
method_18403(class_2338 arg0)
sleep(BlockPos arg0)
public void
fS()
stopSleeping()
method_18400()
wakeUp()
private boolean
b(long arg0)
golemSpawnConditionsMet(long arg0)
method_20741(long arg0)
hasRecentlySlept(long worldTime)