Package net.minecraft.world.entity.npc
Class Villager
- All Implemented Interfaces:
CommandSource
,InventoryCarrier
,Npc
,VillagerDataHolder
,ReputationEventHandler
,Merchant
,EntityAccess
,Nameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundTag>
,IForgeEntity
,INBTSerializable<CompoundTag>
public class Villager
extends AbstractVillager
implements ReputationEventHandler, VillagerDataHolder
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.AgeableMob
AgeableMob.AgeableMobGroupData
Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
static int
private boolean
private static EntityDataAccessor<VillagerData>
private byte
private static int
private static int
private GossipContainer
private static int
private static int
private boolean
private long
private long
private long
private long
private Player
private static int
private static com.google.common.collect.ImmutableList<MemoryModuleType<?>>
private int
static Map<MemoryModuleType<GlobalPos>,BiPredicate<Villager,PoiType>>
private static int
private static com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>>
static float
private static long
private static int
private int
private int
Fields inherited from class net.minecraft.world.entity.npc.AbstractVillager
offers, VILLAGER_SLOT_OFFSET
Fields inherited from class net.minecraft.world.entity.AgeableMob
age, BABY_START_AGE, forcedAge, forcedAgeTimer
Fields inherited from class net.minecraft.world.entity.Mob
ambientSoundTime, armorDropChances, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, LEASH_TAG, lookControl, MAX_ENCHANTED_ARMOR_CHANCE, MAX_ENCHANTED_WEAPON_CHANCE, MAX_PICKUP_LOOT_CHANCE, MAX_WEARING_ARMOR_CHANCE, moveControl, navigation, targetSelector, xpReward
Fields inherited from class net.minecraft.world.entity.LivingEntity
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BASE_GRAVITY, DEFAULT_EYE_HEIGHT, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, flyingSpeed, HAND_SLOTS, hurtDir, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, lyHeadRot, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, oRun, PLAYER_HURT_EXPERIENCE_TIME, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, timeOffs, USE_ITEM_INTERVAL, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
Fields inherited from class net.minecraft.world.entity.Entity
BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, fluidOnEyes, flyDist, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, level, LOGGER, MAX_ENTITY_TAG_COUNT, maxUpStep, moveDist, noCulling, noPhysics, onGround, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
-
Constructor Summary
ConstructorDescriptionVillager(EntityType<? extends Villager> p_35381_, Level p_35382_)
Villager(EntityType<? extends Villager> p_35384_, Level p_35385_, VillagerType p_35386_)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalSaveData(CompoundTag p_35481_)
protected void
private boolean
boolean
protected Brain.Provider<Villager>
boolean
canBreed()
boolean
private void
private int
static AttributeSupplier.Builder
protected void
protected void
void
die(DamageSource p_35419_)
private void
digestFood(int p_35549_)
void
private void
finalizeSpawn(ServerLevelAccessor p_35439_, DifficultyInstance p_35440_, MobSpawnType p_35441_, SpawnGroupData p_35442_, CompoundTag p_35443_)
private BlockPos
findSpawnPositionForGolemInColumn(BlockPos p_35447_, double p_35448_, double p_35449_)
protected SoundEvent
getBrain()
getBreedOffspring(ServerLevel p_150012_, AgeableMob p_150013_)
protected SoundEvent
protected SoundEvent
getHurtSound(DamageSource p_35498_)
int
getPlayerReputation(Player p_35533_)
protected Component
int
private boolean
golemSpawnConditionsMet(long p_35462_)
void
gossip(ServerLevel p_35412_, Villager p_35413_, long p_35414_)
void
handleEntityEvent(byte p_35391_)
boolean
boolean
private boolean
hungry()
private void
boolean
protected Brain<?>
makeBrain(com.mojang.serialization.Dynamic<?> p_35445_)
private void
mobInteract(Player p_35472_, InteractionHand p_35473_)
private boolean
void
onReputationEventFrom(ReputationEventType p_35431_, Entity p_35432_)
protected void
pickUpItem(ItemEntity p_35467_)
void
void
readAdditionalSaveData(CompoundTag p_35451_)
void
refreshBrain(ServerLevel p_35484_)
private void
registerBrainGoals(Brain<Villager> p_35425_)
private void
void
releasePoi(MemoryModuleType<GlobalPos> p_35429_)
boolean
removeWhenFarAway(double p_35535_)
private void
private void
void
restock()
protected void
rewardTradeXp(MerchantOffer p_35475_)
protected void
void
setChasing(boolean p_150016_)
void
setGossips(Tag p_35456_)
void
setLastHurtByMob(LivingEntity p_35423_)
void
setOffers(MerchantOffers p_35477_)
void
setTradingPlayer(Player p_35508_)
private void
void
setVillagerData(VillagerData p_35437_)
void
setVillagerXp(int p_35547_)
private boolean
boolean
void
spawnGolemIfNeeded(ServerLevel p_35398_, long p_35399_, int p_35400_)
void
startSleeping(BlockPos p_35479_)
private void
startTrading(Player p_35537_)
void
protected void
private void
tellWitnessesThatIWasMurdered(Entity p_35421_)
void
thunderHit(ServerLevel p_35409_, LightningBolt p_35410_)
void
tick()
private IronGolem
trySpawnGolem(ServerLevel p_35491_)
private void
private void
updateSpecialPrices(Player p_35541_)
protected void
boolean
boolean
wantsToPickUp(ItemStack p_35543_)
boolean
wantsToSpawnGolem(long p_35393_)
Methods inherited from class net.minecraft.world.entity.npc.AbstractVillager
addOffersFromItemListings, addParticlesAroundSelf, canBeLeashed, changeDimension, getInventory, getLevel, getNotifyTradeSound, getOffers, getRopeHoldPosition, getSlot, getStandingEyeHeight, getTradeUpdatedSound, getTradingPlayer, getUnhappyCounter, isTrading, notifyTrade, notifyTradeUpdated, overrideOffers, overrideXp, playCelebrateSound, setUnhappyCounter, showProgressBar
Methods inherited from class net.minecraft.world.entity.AgeableMob
ageUp, ageUp, aiStep, getAge, isBaby, onSyncedDataUpdated, setAge, setBaby
Methods inherited from class net.minecraft.world.entity.PathfinderMob
checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
Methods inherited from class net.minecraft.world.entity.Mob
ate, baseTick, canAttackType, canBeControlledByRider, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clearRestriction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, getAmbientSoundInterval, getArmorSlots, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMeleeAttackRangeSqr, getMoveControl, getNavigation, getPathfindingMalus, getPickResult, getRestrictCenter, getRestrictRadius, getSensing, getTarget, hasRestriction, interact, isAggressive, isControlledByLocalInstance, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSunBurnTick, isWithinRestriction, isWithinRestriction, jumpInLiquid, lookAt, onOffspringSpawnedFromEgg, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeFreeWill, requiresCustomPersistence, restrictTo, serverAiStep, setAggressive, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tickHeadTurn, updateControlFlags
Methods inherited from class net.minecraft.world.entity.LivingEntity
actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canFreeze, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, decreaseAirSupply, doAutoAttackOnTouch, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, equipEventAndSound, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAddEntityPacket, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getCapability, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getEyeHeight, getFallDamageSound, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getItemInHand, getJumpBoostPower, getJumpPower, getKillCredit, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRandom, getRelativePortalPosition, getScale, getSleepingPos, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseAirSupply, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadTo, lerpTo, lookAt, markHurt, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onItemPickup, onLeaveCombat, onSoulSpeedBlock, outOfWorld, playBlockFallSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, reviveCaps, rideableUnderWater, rideTick, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setOnGround, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, spawnSoulSpeedParticle, startAutoSpinAttack, startUsingItem, stopRiding, stopUsingItem, swing, swing, take, tickDeath, tickEffects, travel, triggerItemUseEffects, tryAddFrost, tryAddSoulSpeed, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, verifyEquippedItem
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkInsideBlocks, checkOutOfWorld, chunkPosition, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, discard, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, eyeBlockPosition, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, gameEvent, gameEvent, gameEvent, gameEvent, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getForward, getGameEventListenerRegistrar, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMotionDirection, getMovementEmission, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersAndSelf, getPassengersRidingOffset, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFullyFrozen, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killed, lavaHurt, lerpMotion, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, occludesVibrations, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, pick, playEntityOnFireExtinguishedSound, playerTouch, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, recreateFromPacket, refreshDimensions, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevelCallback, setNoGravity, setOldPosAndRot, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, teleportTo, teleportToWithTicket, toString, touchingUnloadedChunk, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
Methods inherited from interface net.minecraft.world.item.trading.Merchant
openTradingScreen
-
Field Details
-
DATA_VILLAGER_DATA
-
BREEDING_FOOD_THRESHOLD
public static final int BREEDING_FOOD_THRESHOLD- See Also:
- Constant Field Values
-
FOOD_POINTS
-
TRADES_PER_LEVEL
private static final int TRADES_PER_LEVEL- See Also:
- Constant Field Values
-
WANTED_ITEMS
-
MAX_GOSSIP_TOPICS
private static final int MAX_GOSSIP_TOPICS- See Also:
- Constant Field Values
-
GOSSIP_COOLDOWN
private static final int GOSSIP_COOLDOWN- See Also:
- Constant Field Values
-
GOSSIP_DECAY_INTERVAL
private static final int GOSSIP_DECAY_INTERVAL- See Also:
- Constant Field Values
-
REPUTATION_CHANGE_PER_EVENT
private static final int REPUTATION_CHANGE_PER_EVENT- See Also:
- Constant Field Values
-
HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS
private static final int HOW_FAR_AWAY_TO_TALK_TO_OTHER_VILLAGERS_ABOUT_GOLEMS- See Also:
- Constant Field Values
-
HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM
private static final int HOW_MANY_VILLAGERS_NEED_TO_AGREE_TO_SPAWN_A_GOLEM- See Also:
- Constant Field Values
-
TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING
private static final long TIME_SINCE_SLEEPING_FOR_GOLEM_SPAWNING- See Also:
- Constant Field Values
-
SPEED_MODIFIER
public static final float SPEED_MODIFIER- See Also:
- Constant Field Values
-
updateMerchantTimer
private int updateMerchantTimer -
increaseProfessionLevelOnUpdate
private boolean increaseProfessionLevelOnUpdate -
lastTradedPlayer
-
chasing
private boolean chasing -
foodLevel
private byte foodLevel -
gossips
-
lastGossipTime
private long lastGossipTime -
lastGossipDecayTime
private long lastGossipDecayTime -
villagerXp
private int villagerXp -
lastRestockGameTime
private long lastRestockGameTime -
numberOfRestocksToday
private int numberOfRestocksToday -
lastRestockCheckDayTime
private long lastRestockCheckDayTime -
assignProfessionWhenSpawned
private boolean assignProfessionWhenSpawned -
MEMORY_TYPES
-
SENSOR_TYPES
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super Villager>>> SENSOR_TYPES -
POI_MEMORIES
-
-
Constructor Details
-
Villager
-
Villager
-
-
Method Details
-
getBrain
- Overrides:
getBrain
in classLivingEntity
-
brainProvider
- Overrides:
brainProvider
in classLivingEntity
-
makeBrain
- Overrides:
makeBrain
in classLivingEntity
-
refreshBrain
-
registerBrainGoals
-
ageBoundaryReached
protected void ageBoundaryReached()- Overrides:
ageBoundaryReached
in classAgeableMob
-
createAttributes
-
assignProfessionWhenSpawned
public boolean assignProfessionWhenSpawned() -
customServerAiStep
protected void customServerAiStep()- Overrides:
customServerAiStep
in classMob
-
tick
public void tick() -
mobInteract
- Overrides:
mobInteract
in classMob
-
setUnhappy
private void setUnhappy() -
startTrading
-
setTradingPlayer
- Specified by:
setTradingPlayer
in interfaceMerchant
- Overrides:
setTradingPlayer
in classAbstractVillager
-
stopTrading
protected void stopTrading()- Overrides:
stopTrading
in classAbstractVillager
-
resetSpecialPrices
private void resetSpecialPrices() -
canRestock
public boolean canRestock()- Specified by:
canRestock
in interfaceMerchant
-
restock
public void restock() -
needsToRestock
private boolean needsToRestock() -
allowedToRestock
private boolean allowedToRestock() -
shouldRestock
public boolean shouldRestock() -
catchUpDemand
private void catchUpDemand() -
updateDemand
private void updateDemand() -
updateSpecialPrices
-
defineSynchedData
protected void defineSynchedData()- Overrides:
defineSynchedData
in classAbstractVillager
-
addAdditionalSaveData
- Overrides:
addAdditionalSaveData
in classAbstractVillager
-
readAdditionalSaveData
- Overrides:
readAdditionalSaveData
in classAbstractVillager
-
removeWhenFarAway
public boolean removeWhenFarAway(double p_35535_)- Overrides:
removeWhenFarAway
in classMob
-
getAmbientSound
- Overrides:
getAmbientSound
in classMob
-
getHurtSound
- Overrides:
getHurtSound
in classLivingEntity
-
getDeathSound
- Overrides:
getDeathSound
in classLivingEntity
-
playWorkSound
public void playWorkSound() -
setVillagerData
- Specified by:
setVillagerData
in interfaceVillagerDataHolder
-
getVillagerData
- Specified by:
getVillagerData
in interfaceVillagerDataHolder
-
rewardTradeXp
- Specified by:
rewardTradeXp
in classAbstractVillager
-
setChasing
public void setChasing(boolean p_150016_) -
isChasing
public boolean isChasing() -
setLastHurtByMob
- Overrides:
setLastHurtByMob
in classLivingEntity
-
die
- Overrides:
die
in classAbstractVillager
-
releaseAllPois
private void releaseAllPois() -
tellWitnessesThatIWasMurdered
-
releasePoi
-
canBreed
public boolean canBreed()- Overrides:
canBreed
in classAgeableMob
-
hungry
private boolean hungry() -
eatUntilFull
private void eatUntilFull() -
getPlayerReputation
-
digestFood
private void digestFood(int p_35549_) -
eatAndDigestFood
public void eatAndDigestFood() -
setOffers
-
shouldIncreaseLevel
private boolean shouldIncreaseLevel() -
increaseMerchantCareer
private void increaseMerchantCareer() -
getTypeName
- Overrides:
getTypeName
in classEntity
-
handleEntityEvent
public void handleEntityEvent(byte p_35391_)- Overrides:
handleEntityEvent
in classMob
-
finalizeSpawn
@Nullable public SpawnGroupData finalizeSpawn(ServerLevelAccessor p_35439_, DifficultyInstance p_35440_, MobSpawnType p_35441_, @Nullable SpawnGroupData p_35442_, @Nullable CompoundTag p_35443_)- Overrides:
finalizeSpawn
in classAbstractVillager
-
getBreedOffspring
- Specified by:
getBreedOffspring
in classAgeableMob
-
thunderHit
- Overrides:
thunderHit
in classEntity
-
pickUpItem
- Overrides:
pickUpItem
in classMob
-
wantsToPickUp
- Overrides:
wantsToPickUp
in classMob
-
hasExcessFood
public boolean hasExcessFood() -
wantsMoreFood
public boolean wantsMoreFood() -
countFoodPointsInInventory
private int countFoodPointsInInventory() -
hasFarmSeeds
public boolean hasFarmSeeds() -
updateTrades
protected void updateTrades()- Specified by:
updateTrades
in classAbstractVillager
-
gossip
-
maybeDecayGossip
private void maybeDecayGossip() -
spawnGolemIfNeeded
-
wantsToSpawnGolem
public boolean wantsToSpawnGolem(long p_35393_) -
trySpawnGolem
-
findSpawnPositionForGolemInColumn
-
onReputationEventFrom
- Specified by:
onReputationEventFrom
in interfaceReputationEventHandler
-
getVillagerXp
public int getVillagerXp()- Specified by:
getVillagerXp
in interfaceMerchant
- Overrides:
getVillagerXp
in classAbstractVillager
-
setVillagerXp
public void setVillagerXp(int p_35547_) -
resetNumberOfRestocks
private void resetNumberOfRestocks() -
getGossips
-
setGossips
-
sendDebugPackets
protected void sendDebugPackets()- Overrides:
sendDebugPackets
in classMob
-
startSleeping
- Overrides:
startSleeping
in classLivingEntity
-
stopSleeping
public void stopSleeping()- Overrides:
stopSleeping
in classLivingEntity
-
golemSpawnConditionsMet
private boolean golemSpawnConditionsMet(long p_35462_)
-