public class VillagerEntity extends AbstractVillagerEntity implements IReputationTracking, IVillagerDataHolder
AgeableEntity.AgeableData
Entity.IMoveCallback
Modifier and Type | Field and Description |
---|---|
private boolean |
assignProfessionWhenSpawned |
private static DataParameter<VillagerData> |
DATA_VILLAGER_DATA |
static java.util.Map<Item,java.lang.Integer> |
FOOD_POINTS |
private byte |
foodLevel |
private GossipManager |
gossips |
private boolean |
increaseProfessionLevelOnUpdate |
private long |
lastGossipDecayTime |
private long |
lastGossipTime |
private long |
lastRestockCheckDayTime |
private long |
lastRestockGameTime |
private PlayerEntity |
lastTradedPlayer |
private static com.google.common.collect.ImmutableList<MemoryModuleType<?>> |
MEMORY_TYPES |
private int |
numberOfRestocksToday |
static java.util.Map<MemoryModuleType<GlobalPos>,java.util.function.BiPredicate<VillagerEntity,PointOfInterestType>> |
POI_MEMORIES |
private static com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super VillagerEntity>>> |
SENSOR_TYPES |
private int |
updateMerchantTimer |
private int |
villagerXp |
private static java.util.Set<Item> |
WANTED_ITEMS |
offers
age, forcedAge, forcedAgeTimer
ambientSoundTime, armorDropChances, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector, xpReward
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, deathScore, deathTime, fallFlyTicks, flyingSpeed, hurtDir, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, lyHeadRot, noActionTime, oAttackAnim, oRun, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, timeOffs, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
NULL
Constructor and Description |
---|
VillagerEntity(EntityType<? extends VillagerEntity> p_i50182_1_,
World p_i50182_2_) |
VillagerEntity(EntityType<? extends VillagerEntity> p_i50183_1_,
World p_i50183_2_,
VillagerType p_i50183_3_) |
addOffersFromItemListings, addParticlesAroundSelf, canBeLeashed, changeDimension, getInventory, getLevel, getNotifyTradeSound, getOffers, getRopeHoldPosition, getStandingEyeHeight, getTradeUpdatedSound, getTradingPlayer, getUnhappyCounter, isTrading, notifyTrade, notifyTradeUpdated, overrideOffers, overrideXp, playCelebrateSound, setSlot, setUnhappyCounter, showProgressBar
ageUp, ageUp, aiStep, getAge, isBaby, onSyncedDataUpdated, setAge, setBaby
checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
ate, baseTick, canAttack, canAttackType, canBeControlledByRider, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, getAmbientSoundInterval, getArmorSlots, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getEquipmentSlotForItem, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getNavigation, getPathfindingMalus, getRestrictCenter, getRestrictRadius, getSensing, getTarget, hasRestriction, interact, isAggressive, isControlledByLocalInstance, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSunBurnTick, isValidSlotForItem, isWithinRestriction, isWithinRestriction, jumpInLiquid, lookAt, onOffspringSpawnedFromEgg, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, 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
actuallyHurt, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canBeAffected, canBreatheUnderwater, canSee, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, decreaseAirSupply, doAutoAttackOnTouch, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, 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, getEyeHeight, getFallDamageSound, getFallFlyingTicks, getFeetBlockState, getFluidFallingAdjustedMovement, getHealth, getItemInHand, 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, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, increaseAirSupply, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, 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, playEquipSound, push, pushEntities, randomTeleport, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, rideableUnderWater, rideTick, setAbsorptionAmount, setArrowCount, setHealth, setItemInHand, setJumping, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setOnGround, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, spawnSoulSpeedParticle, startAutoSpinAttack, startUsingItem, stopRiding, stopUsingItem, swing, swing, take, tickDeath, tickEffects, travel, triggerItemUseEffects, tryAddSoulSpeed, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMotionDirection, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersRidingOffset, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getY, getY, getZ, getZ, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isMovementNoisy, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killed, lavaHurt, lerpMotion, limitPistonMovement, load, makeFlySound, makeStuckInBlock, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, pick, playerTouch, playFlySound, playSound, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setLevel, setLocationFromBoundingbox, setNoGravity, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSwimming, setUUID, setViewScale, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, teleportTo, teleportToWithTicket, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
openTradingScreen
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getEntity, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
getCapability
private static final DataParameter<VillagerData> DATA_VILLAGER_DATA
public static final java.util.Map<Item,java.lang.Integer> FOOD_POINTS
private static final java.util.Set<Item> WANTED_ITEMS
private int updateMerchantTimer
private boolean increaseProfessionLevelOnUpdate
@Nullable private PlayerEntity lastTradedPlayer
private byte foodLevel
private final GossipManager gossips
private long lastGossipTime
private long lastGossipDecayTime
private int villagerXp
private long lastRestockGameTime
private int numberOfRestocksToday
private long lastRestockCheckDayTime
private boolean assignProfessionWhenSpawned
private static final com.google.common.collect.ImmutableList<MemoryModuleType<?>> MEMORY_TYPES
private static final com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super VillagerEntity>>> SENSOR_TYPES
public static final java.util.Map<MemoryModuleType<GlobalPos>,java.util.function.BiPredicate<VillagerEntity,PointOfInterestType>> POI_MEMORIES
public VillagerEntity(EntityType<? extends VillagerEntity> p_i50182_1_, World p_i50182_2_)
public VillagerEntity(EntityType<? extends VillagerEntity> p_i50183_1_, World p_i50183_2_, VillagerType p_i50183_3_)
public Brain<VillagerEntity> getBrain()
getBrain
in class LivingEntity
protected Brain.BrainCodec<VillagerEntity> brainProvider()
brainProvider
in class LivingEntity
protected Brain<?> makeBrain(com.mojang.serialization.Dynamic<?> p_213364_1_)
makeBrain
in class LivingEntity
public void refreshBrain(ServerWorld p_213770_1_)
private void registerBrainGoals(Brain<VillagerEntity> p_213744_1_)
protected void ageBoundaryReached()
ageBoundaryReached
in class AgeableEntity
public static AttributeModifierMap.MutableAttribute createAttributes()
public boolean assignProfessionWhenSpawned()
protected void customServerAiStep()
customServerAiStep
in class MobEntity
public ActionResultType mobInteract(PlayerEntity p_230254_1_, Hand p_230254_2_)
mobInteract
in class MobEntity
private void setUnhappy()
private void startTrading(PlayerEntity p_213740_1_)
public void setTradingPlayer(@Nullable PlayerEntity p_70932_1_)
setTradingPlayer
in interface IMerchant
setTradingPlayer
in class AbstractVillagerEntity
protected void stopTrading()
stopTrading
in class AbstractVillagerEntity
private void resetSpecialPrices()
public boolean canRestock()
canRestock
in interface IMerchant
public void restock()
private boolean needsToRestock()
private boolean allowedToRestock()
public boolean shouldRestock()
private void catchUpDemand()
private void updateDemand()
private void updateSpecialPrices(PlayerEntity p_213762_1_)
protected void defineSynchedData()
defineSynchedData
in class AbstractVillagerEntity
public void addAdditionalSaveData(CompoundNBT p_213281_1_)
addAdditionalSaveData
in class AbstractVillagerEntity
public void readAdditionalSaveData(CompoundNBT p_70037_1_)
readAdditionalSaveData
in class AbstractVillagerEntity
public boolean removeWhenFarAway(double p_213397_1_)
removeWhenFarAway
in class MobEntity
@Nullable protected SoundEvent getAmbientSound()
getAmbientSound
in class MobEntity
protected SoundEvent getHurtSound(DamageSource p_184601_1_)
getHurtSound
in class LivingEntity
protected SoundEvent getDeathSound()
getDeathSound
in class LivingEntity
public void playWorkSound()
public void setVillagerData(VillagerData p_213753_1_)
public VillagerData getVillagerData()
getVillagerData
in interface IVillagerDataHolder
protected void rewardTradeXp(MerchantOffer p_213713_1_)
rewardTradeXp
in class AbstractVillagerEntity
public void setLastHurtByMob(@Nullable LivingEntity p_70604_1_)
setLastHurtByMob
in class LivingEntity
public void die(DamageSource p_70645_1_)
die
in class AbstractVillagerEntity
private void releaseAllPois()
private void tellWitnessesThatIWasMurdered(Entity p_223361_1_)
public void releasePoi(MemoryModuleType<GlobalPos> p_213742_1_)
public boolean canBreed()
canBreed
in class AgeableEntity
private boolean hungry()
private void eatUntilFull()
public int getPlayerReputation(PlayerEntity p_223107_1_)
private void digestFood(int p_213758_1_)
public void eatAndDigestFood()
public void setOffers(MerchantOffers p_213768_1_)
private boolean shouldIncreaseLevel()
private void increaseMerchantCareer()
protected ITextComponent getTypeName()
getTypeName
in class Entity
public void handleEntityEvent(byte p_70103_1_)
handleEntityEvent
in class MobEntity
@Nullable public ILivingEntityData finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, @Nullable ILivingEntityData p_213386_4_, @Nullable CompoundNBT p_213386_5_)
finalizeSpawn
in class AbstractVillagerEntity
public VillagerEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
getBreedOffspring
in class AgeableEntity
public void thunderHit(ServerWorld p_241841_1_, LightningBoltEntity p_241841_2_)
thunderHit
in class Entity
protected void pickUpItem(ItemEntity p_175445_1_)
pickUpItem
in class MobEntity
public boolean wantsToPickUp(ItemStack p_230293_1_)
wantsToPickUp
in class MobEntity
public boolean hasExcessFood()
public boolean wantsMoreFood()
private int countFoodPointsInInventory()
public boolean hasFarmSeeds()
protected void updateTrades()
updateTrades
in class AbstractVillagerEntity
public void gossip(ServerWorld p_242368_1_, VillagerEntity p_242368_2_, long p_242368_3_)
private void maybeDecayGossip()
public void spawnGolemIfNeeded(ServerWorld p_242367_1_, long p_242367_2_, int p_242367_4_)
public boolean wantsToSpawnGolem(long p_223350_1_)
@Nullable private IronGolemEntity trySpawnGolem(ServerWorld p_213759_1_)
@Nullable private BlockPos findSpawnPositionForGolemInColumn(BlockPos p_241433_1_, double p_241433_2_, double p_241433_4_)
public void onReputationEventFrom(IReputationType p_213739_1_, Entity p_213739_2_)
onReputationEventFrom
in interface IReputationTracking
public int getVillagerXp()
getVillagerXp
in interface IMerchant
getVillagerXp
in class AbstractVillagerEntity
public void setVillagerXp(int p_213761_1_)
private void resetNumberOfRestocks()
public GossipManager getGossips()
public void setGossips(INBT p_223716_1_)
protected void sendDebugPackets()
sendDebugPackets
in class MobEntity
public void startSleeping(BlockPos p_213342_1_)
startSleeping
in class LivingEntity
public void stopSleeping()
stopSleeping
in class LivingEntity
private boolean golemSpawnConditionsMet(long p_223352_1_)