net.minecraft.world.entity.npc

public class Villager

extends AbstractVillager implements ReputationEventHandler, VillagerDataHolder

All mapped superinterfaces:

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

cqe
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
bL
LOGGER
field_36335
LOGGER
private static final EntityDataAccessor<VillagerData>
bM
DATA_VILLAGER_DATA
field_7445
VILLAGER_DATA
public static final int
bH
BREEDING_FOOD_THRESHOLD
field_30602
field_30602
public static final Map<Item, Integer>
bI
FOOD_POINTS
field_18526
ITEM_FOOD_VALUES
private static final int
bN
TRADES_PER_LEVEL
field_30604
field_30604
private static final int
bO
MAX_GOSSIP_TOPICS
field_30605
field_30605
private static final int
bP
GOSSIP_COOLDOWN
field_30606
field_30606
private static final int
bQ
GOSSIP_DECAY_INTERVAL
field_30607
field_30607
private static final int
bR
HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS
field_30609
field_30609
private static final int
bS
HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM
field_30610
field_30610
private static final long
bT
TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING
field_30611
field_30611
public static final float
bJ
SPEED_MODIFIER
field_30603
field_30603
private int
bU
updateMerchantTimer
field_18528
levelUpTimer
private boolean
bV
increaseProfessionLevelOnUpdate
field_18529
levelingUp
private Player
bW
lastTradedPlayer
field_18530
lastCustomer
private boolean
bX
chasing
field_30612
field_30612
private int
bY
foodLevel
field_18533
foodLevel
private final GossipContainer
bZ
gossips
field_18534
gossip
private long
ca
lastGossipTime
field_18535
gossipStartTime
private long
cb
lastGossipDecayTime
field_19357
lastGossipDecayTime
private int
cc
villagerXp
field_18536
experience
private long
cd
lastRestockGameTime
field_18537
lastRestockTime
private int
ce
numberOfRestocksToday
field_19427
restocksToday
private long
cf
lastRestockCheckDayTime
field_20332
lastRestockCheckTime
private boolean
cg
assignProfessionWhenSpawned
field_25167
natural
private static final com.google.common.collect.ImmutableList<MemoryModuleType<?>>
ch
MEMORY_TYPES
field_18538
MEMORY_MODULES
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>>
ci
SENSOR_TYPES
field_18539
SENSORS
public static final Map<MemoryModuleType<GlobalPos>, BiPredicate<Villager, Holder<PoiType>>>
bK
POI_MEMORIES
field_18851
POINTS_OF_INTEREST

Constructor summary

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

Method summary

Modifier and TypeMethod
public Brain<Villager>
eb()
getBrain()
method_18868()
getBrain()
protected Brain$Provider<Villager>
ec()
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(aro arg0)
refreshBrain(ServerLevel arg0)
method_19179(class_3218 arg0)
reinitializeBrain(ServerWorld world)
private void
a(bxz<cqe> arg0)
registerBrainGoals(Brain<Villager> arg0)
method_19174(class_4095<class_1646> arg0)
initBrain(Brain<VillagerEntity> brain)
protected void
j()
ageBoundaryReached()
method_5619()
onGrowUp()
public static AttributeSupplier$Builder
gz()
createAttributes()
method_26955()
createVillagerAttributes()
public boolean
gA()
assignProfessionWhenSpawned()
method_29279()
isNatural()
protected void
a(aro arg0)
customServerAiStep(ServerLevel arg0)
method_5958(class_3218 arg0)
mobTick(ServerWorld arg0)
public void
h()
tick()
method_5773()
tick()
public InteractionResult
b(cqs arg0, btx arg1)
mobInteract(Player arg0, InteractionHand arg1)
method_5992(class_1657 arg0, class_1268 arg1)
interactMob(PlayerEntity arg0, Hand arg1)
private void
gK()
setUnhappy()
method_20264()
sayNo()
private void
g(cqs arg0)
startTrading(Player arg0)
method_19191(class_1657 arg0)
beginTradeWith(PlayerEntity customer)
public void
a(cqs arg0)
setTradingPlayer(Player arg0)
method_8259(class_1657 arg0)
setCustomer(PlayerEntity arg0)
protected void
gv()
stopTrading()
method_19181()
resetCustomer()
private void
gL()
resetSpecialPrices()
method_19187()
clearSpecialPrices()
public boolean
gB()
canRestock()
method_20708()
canRefreshTrades()
public void
gC()
restock()
method_19182()
restock()
private void
gM()
resendOffersToTradingPlayer()
method_49695()
sendOffersToCustomer()
private boolean
gN()
needsToRestock()
method_20823()
needsRestock()
private boolean
gO()
allowedToRestock()
method_20824()
canRestock()
public boolean
gD()
shouldRestock()
method_20822()
shouldRestock()
private void
gP()
catchUpDemand()
method_21723()
restockAndUpdateDemandBonus()
private void
gQ()
updateDemand()
method_21724()
updateDemandBonus()
private void
h(cqs arg0)
updateSpecialPrices(Player arg0)
method_19192(class_1657 arg0)
prepareOffersFor(PlayerEntity player)
protected void
a(akl$a arg0)
defineSynchedData(SynchedEntityData$Builder arg0)
method_5693(class_2945$class_9222 arg0)
initDataTracker(DataTracker$Builder arg0)
public void
b(tx arg0)
addAdditionalSaveData(CompoundTag arg0)
method_5652(class_2487 arg0)
writeCustomDataToNbt(NbtCompound arg0)
public void
a(tx 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(bup arg0)
getHurtSound(DamageSource arg0)
method_6011(class_1282 arg0)
getHurtSound(DamageSource arg0)
protected SoundEvent
l_()
getDeathSound()
method_6002()
getDeathSound()
public void
gE()
playWorkSound()
method_19183()
playWorkSound()
public void
a(cqf arg0)
setVillagerData(VillagerData arg0)
method_7195(class_3850 arg0)
setVillagerData(VillagerData arg0)
public VillagerData
gy()
getVillagerData()
method_7231()
getVillagerData()
protected void
b(dhn arg0)
rewardTradeXp(MerchantOffer arg0)
method_18008(class_1914 arg0)
afterUsing(TradeOffer arg0)
public void
a(bwz arg0)
setLastHurtByMob(LivingEntity arg0)
method_6015(class_1309 arg0)
setAttacker(LivingEntity arg0)
public void
a(bup arg0)
die(DamageSource arg0)
method_6078(class_1282 arg0)
onDeath(DamageSource arg0)
private void
gR()
releaseAllPois()
method_30958()
releaseAllTickets()
private void
b(bwa arg0)
tellWitnessesThatIWasMurdered(Entity arg0)
method_20690(class_1297 arg0)
notifyDeath(Entity killer)
public void
a(cgb<jd> arg0)
releasePoi(MemoryModuleType<GlobalPos> arg0)
method_19176(class_4140<class_4208> arg0)
releaseTicketFor(MemoryModuleType<GlobalPos> pos)
public boolean
S_()
canBreed()
method_19184()
isReadyToBreed()
private boolean
gS()
hungry()
method_20698()
canEatFood()
private void
gT()
eatUntilFull()
method_19185()
consumeAvailableFood()
public int
f(cqs 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
gF()
eatAndDigestFood()
method_20697()
eatForBreeding()
public void
b(dho arg0)
setOffers(MerchantOffers arg0)
method_16917(class_1916 arg0)
setOffers(TradeOfferList offers)
private boolean
gU()
shouldIncreaseLevel()
method_19188()
canLevelUp()
private void
gV()
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(djg arg0, btw arg1, bwi arg2, bxr 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(aro arg0, bvq arg1)
getBreedOffspring(ServerLevel arg0, AgeableMob arg1)
method_7225(class_3218 arg0, class_1296 arg1)
createChild(ServerWorld arg0, PassiveEntity arg1)
public void
a(aro arg0, bwy arg1)
thunderHit(ServerLevel arg0, LightningBolt arg1)
method_5800(class_3218 arg0, class_1538 arg1)
onStruckByLightning(ServerWorld arg0, LightningEntity arg1)
protected void
a(aro arg0, cmx arg1)
pickUpItem(ServerLevel arg0, ItemEntity arg1)
method_5949(class_3218 arg0, class_1542 arg1)
loot(ServerWorld arg0, ItemEntity arg1)
public boolean
c(aro arg0, cys arg1)
wantsToPickUp(ServerLevel arg0, ItemStack arg1)
method_20820(class_3218 arg0, class_1799 arg1)
canGather(ServerWorld arg0, ItemStack arg1)
public boolean
gG()
hasExcessFood()
method_7234()
canShareFoodForBreeding()
public boolean
gH()
wantsMoreFood()
method_7239()
needsFoodForBreeding()
private int
gW()
countFoodPointsInInventory()
method_19189()
getAvailableFood()
public boolean
gI()
hasFarmSeeds()
method_19623()
hasSeedToPlant()
protected void
gw()
updateTrades()
method_7237()
fillRecipes()
public void
a(aro arg0, cqe 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
gX()
maybeDecayGossip()
method_20696()
decayGossip()
public void
a(aro 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(chy arg0, bwa 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
gY()
resetNumberOfRestocks()
method_20821()
clearDailyRestockCount()
public GossipContainer
gJ()
getGossips()
method_21651()
getGossip()
public void
a(uu arg0)
setGossips(Tag arg0)
method_21650(class_2520 arg0)
readGossipDataNbt(NbtElement nbt)
protected void
ab()
sendDebugPackets()
method_18409()
sendAiDebugData()
public void
b(iu arg0)
startSleeping(BlockPos arg0)
method_18403(class_2338 arg0)
sleep(BlockPos arg0)
public void
fR()
stopSleeping()
method_18400()
wakeUp()
private boolean
b(long arg0)
golemSpawnConditionsMet(long arg0)
method_20741(long arg0)
hasRecentlySlept(long worldTime)
public <T> T
a(ki<? extends T> arg0)
get(DataComponentType<? extends T> arg0)
method_58694(class_9331<? extends T> arg0)
get(ComponentType<? extends T> arg0)
protected void
a(ke arg0)
applyImplicitComponents(DataComponentGetter arg0)
method_66649(class_9473 arg0)
copyComponentsFrom(ComponentsAccess arg0)
protected <T> boolean
b(ki<T> arg0, T arg1)
applyImplicitComponent(DataComponentType<T> arg0, T arg1)
method_66654(class_9331<T> arg0, T arg1)
setApplicableComponent(ComponentType<T> arg0, T arg1)