public class VillagerEntity extends AbstractVillagerEntity implements IReputationTracking, IVillagerDataHolder
AgeableEntity.AgeableDataEntity.IMoveCallback| Modifier and Type | Field and Description |
|---|---|
private static java.util.Set<Item> |
ALLOWED_INVENTORY_ITEMS |
static java.util.Map<MemoryModuleType<GlobalPos>,java.util.function.BiPredicate<VillagerEntity,PointOfInterestType>> |
field_213774_bB |
private long |
field_213783_bN |
private int |
field_223725_bO |
private long |
field_223726_bP |
static java.util.Map<Item,java.lang.Integer> |
FOOD_VALUES |
private byte |
foodLevel |
private GossipManager |
gossip |
private long |
lastGossipDecay |
private long |
lastRestock |
private boolean |
leveledUp |
private static com.google.common.collect.ImmutableList<MemoryModuleType<?>> |
MEMORY_TYPES |
private PlayerEntity |
previousCustomer |
private static com.google.common.collect.ImmutableList<SensorType<? extends Sensor<? super VillagerEntity>>> |
SENSOR_TYPES |
private int |
timeUntilReset |
private static DataParameter<VillagerData> |
VILLAGER_DATA |
private int |
xp |
offersforcedAge, forcedAgeTimer, growingAgeexperienceValue, goalSelector, inventoryArmorDropChances, inventoryHandsDropChances, jumpController, livingSoundTime, lookController, moveController, navigator, targetSelectoractiveItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, beeStingRemovalCooldown, brain, dead, deathTime, ENTITY_GRAVITY, hurtTime, idleTime, interpTargetHeadYaw, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, interpTicksHead, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, LIVING_FLAGS, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, moveVertical, NAMETAG_DISTANCE, newPosRotationIncrements, onGroundSpeedFactor, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, SLEEPING_SIZE, spinAttackDuration, SWIM_SPEED, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180addedToChunk, cachedUniqueIdString, chunkCoordX, chunkCoordY, chunkCoordZ, collided, collidedHorizontally, collidedVertically, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, eyesInWater, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, hurtResistantTime, ignoreFrustumCheck, inLava, inPortal, inWater, isAirBorne, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, LOGGER, motionMultiplier, noClip, onGround, portalCounter, POSE, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, removed, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, submergedHeight, teleportDirection, ticksExisted, timeUntilPortal, velocityChanged, worldDUMMY| Constructor and Description |
|---|
VillagerEntity(EntityType<? extends VillagerEntity> type,
World worldIn) |
VillagerEntity(EntityType<? extends VillagerEntity> type,
World worldIn,
IVillagerType villagerType) |
addTrades, canBeLeashedTo, changeDimension, func_213705_dZ, getCustomer, getOffers, getShakeHeadTicks, getStandingEyeHeight, getVillagerInventory, getVillagerYesNoSound, getWorld, getYesSound, hasCustomer, onTrade, playCelebrateSound, replaceItemInInventory, setClientSideOffers, setShakeHeadTicks, setXP, spawnParticles, verifySellingItemaddGrowth, ageUp, getGrowingAge, isChild, livingTick, notifyDataManagerChange, onChildSpawnFromEgg, setGrowingAgecanSpawn, followLeashSpeed, getBlockPathWeight, getBlockPathWeight, hasPath, onLeashDistance, updateLeashedStateattackEntityAsMob, baseTick, canAttack, canAttack, canBeSteered, canEquipItem, canPassengerSteer, canPickUpItem, canPickUpLoot, canSpawnOn, checkDespawn, clearLeashed, createBodyController, createNavigator, detachHome, dropLoot, dropSpecialItems, eatGrassBonus, enablePersistence, faceEntity, getArmorByChance, getArmorInventoryList, getAttackTarget, getDropChance, getEntitySenses, getExperiencePoints, getFaceRotSpeed, getHeldEquipment, getHomePosition, getHorizontalFaceSpeed, getItemStackFromSlot, getJumpController, getLeashed, getLeashHolder, getLookController, getLootContextBuilder, getLootTable, getLootTableResourceLocation, getMaxFallHeight, getMaximumHomeDistance, getMaxSpawnedInChunk, getMoveHelper, getNavigator, getPathPriority, getPrimaryHand, getSlotForItemStack, getTalkInterval, getVerticalFaceSpeed, handleFluidJump, isAggressive, isAIDisabled, isDespawnPeaceful, isHolding, isInDaylight, isItemStackInSlot, isLeftHanded, isMaxGroupSize, isNoDespawnRequired, isNotColliding, isServerWorld, isWithinHomeDistanceCurrentPosition, isWithinHomeDistanceFromPosition, playAmbientSound, playHurtSound, preventDespawn, processInitialInteract, registerGoals, setAggroed, setAIMoveSpeed, setAttackTarget, setCanPickUpLoot, setDropChance, setEnchantmentBasedOnDifficulty, setEquipmentBasedOnDifficulty, setHomePosAndDistance, setItemStackToSlot, setLeashHolder, setLeftHanded, setMoveForward, setMoveStrafing, setMoveVertical, setNoAI, setPathPriority, setVehicleEntityId, shouldExchangeEquipment, spawnExplosionParticle, startRiding, updateDistance, updateEntityActionState, updateMovementGoalFlagsaddPotionEffect, applyArmorCalculations, applyEntityCollision, applyPotionDamageCalculations, areAllPotionsAmbient, attackable, attackEntityFrom, attemptTeleport, blockUsingShield, calculateFallDamage, canAttack, canBeCollidedWith, canBeHitWithPotion, canBePushed, canBeRiddenInWater, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, clearBedPosition, collideWithEntity, collideWithNearbyEntities, constructKnockBackVector, createSpawnPacket, createWitherRose, curePotionEffects, damageArmor, damageEntity, damageShield, decreaseAirSupply, determineNextAir, dropExperience, dropInventory, findAmmo, frostWalk, getAbsorptionAmount, getActiveHand, getActiveItemStack, getActivePotionEffect, getActivePotionEffects, getActivePotionMap, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArmorCoverPercentage, getArrowCountInEntity, getAttackingEntity, getAttribute, getAttributes, getBedDirection, getBedPosition, getBeeStingCount, getBlockState, getCapability, getCombatTracker, getCreatureAttribute, getDrinkSound, getEatSound, getEyeHeight, getFallSound, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getIdleTime, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttackedEntity, getLastAttackedEntityTime, getLastDamageSource, getMaxHealth, getRenderScale, getRevengeTarget, getRevengeTimer, getRNG, getRotationYawHead, getSize, getSoundPitch, getSoundVolume, getSwimAnimation, getSwingProgress, getTicksElytraFlying, getTotalArmorValue, getVisibilityMultiplier, getWaterSlowDown, getYaw, handleFluidSneak, hasItemInSlot, heal, isActiveItemStackBlocking, isActualySwimming, isAlive, isElytraFlying, isEntityInsideOpaqueBlock, isEntityUndead, isHandActive, isMovementBlocked, isOnLadder, isPlayer, isPotionActive, isPotionApplicable, isSleeping, isSpinAttacking, isSuppressingSlidingDownLadder, jump, knockBack, lookAt, markPotionsDirty, markVelocityChanged, onChangedPotionEffect, onDeathUpdate, onFinishedPotionEffect, onFoodEaten, onItemPickup, onItemUseFinish, onKillCommand, onLivingFall, onNewPotionEffect, outOfWorld, performHurtAnimation, playEquipSound, playFallSound, remove, removeActivePotionEffect, removePotionEffect, resetActiveHand, resetPotionEffectMetadata, sendBreakAnimation, sendBreakAnimation, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setActiveHand, setArrowCountInEntity, setBedPosition, setBeeStingCount, setHeadRotation, setHealth, setHeldItem, setIdleTime, setJumping, setLastAttackedEntity, setLivingFlag, setPartying, setPositionAndRotationDirect, setRenderYawOffset, setRotationYawHead, setSprinting, shouldRiderFaceForward, spawnDrops, spinAttack, startSpinAttack, stopActiveHand, stopRiding, swing, swingArm, travel, triggerItemUseEffects, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata, updateRidden, updateSpinAttackaddPassenger, addTag, addTrackingPlayer, addVelocity, allowLogging, applyEnchantments, applyOrientationToEntity, applyPlayerInteraction, areEyesInFluid, areEyesInFluid, awardKillScore, calculateUpVector, canBeAttackedWithItem, canBeRidden, canExplosionDestroyBlock, canFitPassenger, canRenderOnFire, canSwim, canTrample, canTriggerWalking, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, collideBoundingBox, collideBoundingBoxHeuristically, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, detach, determineNextStepDistance, doBlockCollisions, doesEntityNotTriggerPressurePlate, doWaterSplashEffect, entityDropItem, entityDropItem, entityDropItem, entityDropItem, equals, extinguish, fillCrashReport, forceSetPosition, getAdjustedHorizontalFacing, getAir, getAllowedMovement, getBoundingBox, getBoundingBox, getBrightness, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSource, getControllingPassenger, getCustomName, getDataManager, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSq, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getEyeHeight, getEyeHeight, getEyePosition, getFireImmuneTicks, getFireTimer, getFlag, getForward, getHeight, getHighspeedSplashSound, getHorizontalFacing, getHoverEvent, getJumpFactor, getLastPortalVec, getLook, getLookVec, getLowestRidingEntity, getMaxAir, getMaxInPortalTime, getMirroredYaw, getMotion, getMountedYOffset, getName, getOnPosition, getPassengers, getPermissionLevel, getPersistentData, getPitch, getPitchYaw, getPortalCooldown, getPose, getPosition, getPositionUnderneath, getPositionVec, getPositionVector, getPosX, getPosXRandom, getPosXWidth, getPosY, getPosYEye, getPosYHeight, getPosYRandom, getPosZ, getPosZRandom, getPosZWidth, getPushReaction, getRecursivePassengers, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getScoreboardName, getSelfAndPassengers, getServer, getSoundCategory, getSpeedFactor, getSplashSound, getSubmergedHeight, getSwimSound, getTags, getTeam, getTeamColor, getTeleportDirection, getType, getUniqueID, getUpVector, getVectorForRotation, getWidth, getYOffset, handleFluidAcceleration, handlePistonMovement, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hasPermissionLevel, hitByEntity, horizontalMag, ignoreItemEntityData, isAddedToWorld, isBeingRidden, isBurning, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEntityEqual, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInvisible, isInvisibleToPlayer, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubbleColumn, isInWaterRainOrBubbleColumn, isLiving, isNonBoss, isOffsetPositionInLiquid, isOnePlayerRiding, isOnSameTeam, isOnScoreboardTeam, isPassenger, isPassenger, isPassenger, isPoseClear, isPushedByWater, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isVisuallySwimming, isWet, makeFlySound, maybeBackOffFromEdge, move, moveForced, moveRelative, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onAddedToWorld, onCollideWithPlayer, onEnterBubbleColumn, onEnterBubbleColumnWithAirAbove, onInsideBlock, onKillEntity, onRemovedFromWorld, pick, playFlySound, playSound, playStepSound, playSwimSound, positionRider, preparePlayerToSpawn, pushOutOfBlocks, read, recalculateSize, recenterBoundingBox, remove, removePassenger, removePassengers, removeTag, removeTrackingPlayer, repositionDirectPassengers, resetPositionToBB, revive, rotateTowards, sendMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFire, setFireTimer, setFlag, setGlowing, setInLava, setInvisible, setInvulnerable, setLocationAndAngles, setMotion, setMotion, setMotionMultiplier, setNoGravity, setOnFireFromLava, setPacketCoordinates, setPortal, setPose, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRawPosition, setRenderDistanceWeight, setRotation, setSilent, setSneaking, setSwimming, setUniqueId, setVelocity, setWorld, shouldReceiveErrors, shouldReceiveFeedback, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, teleportKeepLoaded, toString, updatePassenger, updatePortal, updateSwimming, writeUnlessPassenger, writeUnlessRemoved, writeWithoutTypeIdareCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsclone, finalize, getClass, notify, notifyAll, wait, wait, waitopenMerchantContainercanBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getEntity, getPickedResult, serializeNBT, shouldRiderSitgetCapabilityprivate static final DataParameter<VillagerData> VILLAGER_DATA
public static final java.util.Map<Item,java.lang.Integer> FOOD_VALUES
private static final java.util.Set<Item> ALLOWED_INVENTORY_ITEMS
private int timeUntilReset
private boolean leveledUp
@Nullable private PlayerEntity previousCustomer
private byte foodLevel
private final GossipManager gossip
private long field_213783_bN
private long lastGossipDecay
private int xp
private long lastRestock
private int field_223725_bO
private long field_223726_bP
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>> field_213774_bB
public VillagerEntity(EntityType<? extends VillagerEntity> type, World worldIn)
public VillagerEntity(EntityType<? extends VillagerEntity> type, World worldIn, IVillagerType villagerType)
public Brain<VillagerEntity> getBrain()
getBrain in class LivingEntityprotected Brain<?> createBrain(com.mojang.datafixers.Dynamic<?> dynamicIn)
createBrain in class LivingEntitypublic void resetBrain(ServerWorld serverWorldIn)
private void initBrain(Brain<VillagerEntity> villagerBrain)
protected void onGrowingAdult()
onGrowingAdult in class AgeableEntityprotected void registerAttributes()
registerAttributes in class MobEntityprotected void updateAITasks()
updateAITasks in class MobEntitypublic boolean processInteract(PlayerEntity player, Hand hand)
processInteract in class AgeableEntityprivate void shakeHead()
private void displayMerchantGui(PlayerEntity player)
public void setCustomer(@Nullable
PlayerEntity player)
setCustomer in interface IMerchantsetCustomer in class AbstractVillagerEntityprotected void resetCustomer()
resetCustomer in class AbstractVillagerEntityprivate void resetAllSpecialPrices()
public boolean func_223340_ej()
func_223340_ej in interface IMerchantpublic void func_213766_ei()
private boolean hasUsedOffer()
private boolean func_223720_ew()
public boolean func_223721_ek()
private void func_223719_ex()
private void calculateDemandOfOffers()
private void recalculateSpecialPricesFor(PlayerEntity playerIn)
protected void registerData()
registerData in class AbstractVillagerEntitypublic void writeAdditional(CompoundNBT compound)
writeAdditional in class AbstractVillagerEntitypublic void readAdditional(CompoundNBT compound)
readAdditional in class AbstractVillagerEntitypublic boolean canDespawn(double distanceToClosestPlayer)
canDespawn in class MobEntity@Nullable protected SoundEvent getAmbientSound()
getAmbientSound in class MobEntityprotected SoundEvent getHurtSound(DamageSource damageSourceIn)
getHurtSound in class LivingEntityprotected SoundEvent getDeathSound()
getDeathSound in class LivingEntitypublic void playWorkstationSound()
public void setVillagerData(VillagerData p_213753_1_)
public VillagerData getVillagerData()
getVillagerData in interface IVillagerDataHolderprotected void onVillagerTrade(MerchantOffer offer)
onVillagerTrade in class AbstractVillagerEntitypublic void setRevengeTarget(@Nullable
LivingEntity livingBase)
setRevengeTarget in class LivingEntitypublic void onDeath(DamageSource cause)
onDeath in class AbstractVillagerEntityprivate void func_223361_a(Entity p_223361_1_)
public void func_213742_a(MemoryModuleType<GlobalPos> p_213742_1_)
public boolean canBreed()
private boolean func_223344_ex()
private void func_213765_en()
public int getPlayerReputation(PlayerEntity player)
private void decrFoodLevel(int qty)
public void func_223346_ep()
public void setOffers(MerchantOffers offersIn)
private boolean canLevelUp()
private void levelUp()
protected ITextComponent getProfessionName()
getProfessionName in class Entitypublic void handleStatusUpdate(byte id)
handleStatusUpdate in class MobEntity@Nullable public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
onInitialSpawn in class AbstractVillagerEntitypublic VillagerEntity createChild(AgeableEntity ageable)
createChild in class AgeableEntitypublic void onStruckByLightning(LightningBoltEntity lightningBolt)
onStruckByLightning in class Entityprotected void updateEquipmentIfNeeded(ItemEntity itemEntity)
updateEquipmentIfNeeded in class MobEntitypublic boolean func_223717_b(Item p_223717_1_)
public boolean canAbondonItems()
public boolean wantsMoreFood()
private int getFoodValueFromInventory()
private void dropCraftedBread()
public boolean isFarmItemInInventory()
protected void populateTradeData()
populateTradeData in class AbstractVillagerEntitypublic void func_213746_a(VillagerEntity villager, long gameTime)
private void tickGossip()
public void spawnGolems(long gameTime,
int requiredPeers)
private void updateGolemLastSeenMemory(long gameTime)
private boolean hasSeenGolemRecently(long gameTime)
public boolean canSpawnGolems(long gameTime)
@Nullable private IronGolemEntity trySpawnGolem()
public void updateReputation(IReputationType type, Entity target)
updateReputation in interface IReputationTrackingpublic int getXp()
getXp in interface IMerchantgetXp in class AbstractVillagerEntitypublic void setXp(int xpIn)
private void func_223718_eH()
public GossipManager getGossip()
public void func_223716_a(INBT p_223716_1_)
protected void sendDebugPackets()
sendDebugPackets in class MobEntitypublic void startSleeping(BlockPos pos)
startSleeping in class LivingEntitypublic void wakeUp()
wakeUp in class LivingEntityprivate boolean hasSleptAndWorkedRecently(long gameTime)