public class EntityVillager extends EntityAgeable implements INpc, IMerchant
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityVillager.EmeraldForItems |
static class |
EntityVillager.ItemAndEmeraldToItem |
static interface |
EntityVillager.ITradeList |
static class |
EntityVillager.ListEnchantedBookForEmeralds |
static class |
EntityVillager.ListEnchantedItemForEmeralds |
static class |
EntityVillager.ListItemForEmeralds |
static class |
EntityVillager.PriceInfo |
EntityLiving.SpawnPlacementTypeforcedAge, forcedAgeTimer, growingAgeFLEEING_SPEED_MODIFIER, FLEEING_SPEED_MODIFIER_UUIDexperienceValue, inventoryArmorDropChances, inventoryHandsDropChances, jumpHelper, livingSoundTime, moveHelper, navigator, targetTasks, tasksactiveItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, HAND_STATES, hurtTime, idleTime, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, moveVertical, newPosRotationIncrements, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, SWIM_SPEED, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, collided, collidedHorizontally, collidedVertically, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world| Constructor and Description |
|---|
EntityVillager(World worldIn) |
EntityVillager(World worldIn,
int professionId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyEntityAttributes() |
boolean |
canAbondonItems()
Used by
EntityAIVillagerInteract to check if the
villager can give some items from an inventory to another villager. |
boolean |
canBeLeashedTo(EntityPlayer player) |
protected boolean |
canDespawn()
Determines if an entity can be despawned, used on idle far away entities
|
EntityVillager |
createChild(EntityAgeable ageable) |
protected void |
entityInit() |
IEntityLivingData |
finalizeMobSpawn(DifficultyInstance p_190672_1_,
IEntityLivingData p_190672_2_,
boolean p_190672_3_) |
static EntityVillager.ITradeList[][][][] |
GET_TRADES_DONT_USE()
Deprecated.
|
protected SoundEvent |
getAmbientSound() |
EntityPlayer |
getCustomer() |
protected SoundEvent |
getDeathSound() |
ITextComponent |
getDisplayName()
Get the formatted ChatComponent that will be used for the sender's username in chat
|
float |
getEyeHeight() |
protected SoundEvent |
getHurtSound(DamageSource damageSourceIn) |
boolean |
getIsWillingToMate(boolean updateFirst)
Returns current or updated value of
isWillingToMate |
protected ResourceLocation |
getLootTable() |
BlockPos |
getPos() |
int |
getProfession()
Deprecated.
|
VillagerRegistry.VillagerProfession |
getProfessionForge() |
MerchantRecipeList |
getRecipes(EntityPlayer player) |
InventoryBasic |
getVillagerInventory() |
World |
getWorld() |
void |
handleStatusUpdate(byte id)
|
boolean |
hasEnoughFoodToBreed() |
protected void |
initEntityAI() |
boolean |
isFarmItemInInventory()
Returns true if villager has seeds, potatoes or carrots in inventory
|
boolean |
isMating() |
boolean |
isPlaying() |
boolean |
isTrading() |
void |
notifyDataManagerChange(DataParameter<?> key) |
void |
onDeath(DamageSource cause)
Called when the mob's health reaches 0.
|
protected void |
onGrowingAdult()
This is called when Entity's growing age timer reaches 0 (negative values are considered as a child, positive as
an adult)
|
IEntityLivingData |
onInitialSpawn(DifficultyInstance difficulty,
IEntityLivingData livingdata)
Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called
when entity is reloaded from nbt.
|
void |
onStruckByLightning(EntityLightningBolt lightningBolt)
Called when a lightning bolt hits the entity.
|
boolean |
processInteract(EntityPlayer player,
EnumHand hand) |
void |
readEntityFromNBT(NBTTagCompound compound)
(abstract) Protected helper method to read subclass entity data from NBT.
|
static void |
registerFixesVillager(DataFixer fixer) |
boolean |
replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn) |
void |
setCustomer(EntityPlayer player) |
void |
setIsWillingToMate(boolean isWillingToMate) |
void |
setLookingForHome() |
void |
setMating(boolean mating) |
void |
setPlaying(boolean playing) |
void |
setProfession(int professionId) |
void |
setProfession(VillagerRegistry.VillagerProfession prof) |
void |
setRecipes(MerchantRecipeList recipeList) |
void |
setRevengeTarget(EntityLivingBase livingBase)
Hint to AI tasks that we were attacked by the passed EntityLivingBase and should retaliate.
|
protected void |
updateAITasks() |
protected void |
updateEquipmentIfNeeded(EntityItem itemEntity)
Tests if this entity should pickup a weapon or an armor.
|
void |
useRecipe(MerchantRecipe recipe) |
void |
verifySellingItem(ItemStack stack)
Notifies the merchant of a possible merchantrecipe being fulfilled or not.
|
boolean |
wantsMoreFood() |
void |
writeEntityToNBT(NBTTagCompound compound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addGrowth, ageUp, getGrowingAge, holdingSpawnEggOfClass, isChild, onLivingUpdate, setGrowingAge, setScale, setScaleForAge, setSizedetachHome, followLeashSpeed, getBlockPathWeight, getCanSpawnHere, getHomePosition, getMaximumHomeDistance, hasHome, hasPath, isWithinHomeDistanceCurrentPosition, isWithinHomeDistanceFromPosition, onLeashDistance, setHomePosAndDistance, updateLeashedStatecanAttackClass, canBeSteered, canEquipItem, canPassengerSteer, canPickUpLoot, clearLeashed, createBodyHelper, createNavigator, despawnEntity, dropEquipment, dropFewItems, dropLoot, eatGrassBonus, enablePersistence, faceEntity, getArmorByChance, getArmorInventoryList, getAttackTarget, getDropItem, getEntitySenses, getExperiencePoints, getHeldEquipment, getHorizontalFaceSpeed, getItemStackFromSlot, getJumpHelper, getLeashed, getLeashHolder, getLookHelper, getMaxFallHeight, getMaxSpawnedInChunk, getMoveHelper, getNavigator, getPathPriority, getPrimaryHand, getRenderSizeModifier, getSlotForItemStack, getTalkInterval, getVerticalFaceSpeed, isAIDisabled, isItemStackInSlot, isLeftHanded, isNoDespawnRequired, isNotColliding, isServerWorld, onEntityUpdate, onUpdate, playHurtSound, playLivingSound, processInitialInteract, registerFixesMob, setAIMoveSpeed, setAttackTarget, setCanPickUpLoot, setDropChance, setEnchantmentBasedOnDifficulty, setEquipmentBasedOnDifficulty, setItemStackToSlot, setLeashHolder, setLeftHanded, setMoveForward, setMoveStrafing, setMoveVertical, setNoAI, setPathPriority, spawnExplosionParticle, startRiding, updateDistance, updateEntityActionStateaddPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, areAllPotionsAmbient, attackable, attackEntityAsMob, attackEntityFrom, attemptTeleport, blockUsingShield, canBeCollidedWith, canBeHitWithPotion, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, damageArmor, damageEntity, damageShield, decreaseAirSupply, dismountEntity, dismountRidingEntity, fall, frostWalk, getAbsorptionAmount, getActiveHand, getActiveItemStack, getActivePotionEffect, getActivePotionEffects, getActivePotionMap, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttackingEntity, getAttributeMap, getCapability, getCombatTracker, getCreatureAttribute, getEntityAttribute, getFallSound, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getIdleTime, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttackedEntity, getLastAttackedEntityTime, getLastDamageSource, getLook, getMaxHealth, getRevengeTarget, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, getTicksElytraFlying, getTotalArmorValue, getWaterSlowDown, handleJumpLava, handleJumpWater, hasCapability, hasItemInSlot, heal, isActiveItemStackBlocking, isElytraFlying, isEntityAlive, isEntityUndead, isHandActive, isMovementBlocked, isOnLadder, isPlayer, isPlayerSleeping, isPotionActive, isPotionApplicable, jump, knockBack, markPotionsDirty, markVelocityChanged, moveRelative, onChangedPotionEffect, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onItemUseFinish, onKillCommand, onNewPotionEffect, outOfWorld, performHurtAnimation, playEquipSound, removeActivePotionEffect, removePotionEffect, renderBrokenItemStack, resetActiveHand, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setActiveHand, setArrowCountInEntity, setHealth, setHeldItem, setJumping, setLastAttackedEntity, setPartying, setPositionAndRotationDirect, setRenderYawOffset, setRotationYawHead, setSprinting, shouldRiderFaceForward, stopActiveHand, swingArm, travel, updateActiveHand, updateArmSwingProgress, updateFallState, updateItemUse, updatePotionEffects, updatePotionMetadata, updateRiddenaddEntityCrashInfo, addPassenger, addTag, addTrackingPlayer, addVelocity, applyEnchantments, applyEntityCollision, applyOrientationToEntity, applyPlayerInteraction, awardKillScore, canBeAttackedWithItem, canBeRidden, canExplosionDestroyBlock, canFitPassenger, canRenderOnFire, canRiderInteract, canTrample, canTriggerWalking, canUseCommand, changeDimension, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, doWaterSplashEffect, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDistance, getDistance, getDistanceSq, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getFireImmuneTicks, getFlag, getForward, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLookVec, getLowestRidingEntity, getMaxInPortalTime, getMirroredYaw, getMountedYOffset, getName, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getServer, getSoundCategory, getSplashSound, getSwimSound, getTags, getTeam, getTeleportDirection, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isAddedToWorld, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isOverWater, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, makeFlySound, move, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onAddedToWorld, onCollideWithPlayer, onInsideBlock, onKillEntity, onRemovedFromWorld, playFlySound, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, resetEntityId, resetPositionToBB, sendCommandFeedback, sendMessage, serializeNBT, setAir, setAlwaysRenderNameTag, setCommandStat, setCommandStats, setCustomNameTag, setDead, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setInWeb, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRotation, setSilent, setSneaking, setUniqueId, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, toString, turn, updatePassenger, writeToNBT, writeToNBTAtomically, writeToNBTOptionalpublic EntityVillager(World worldIn)
public EntityVillager(World worldIn, int professionId)
protected void initEntityAI()
initEntityAI in class EntityLivingprotected void onGrowingAdult()
onGrowingAdult in class EntityAgeableprotected void applyEntityAttributes()
applyEntityAttributes in class EntityLivingprotected void updateAITasks()
updateAITasks in class EntityLivingpublic boolean processInteract(EntityPlayer player, EnumHand hand)
processInteract in class EntityAgeableprotected void entityInit()
entityInit in class EntityAgeablepublic static void registerFixesVillager(DataFixer fixer)
public void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT in class EntityAgeablepublic void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT in class EntityAgeableprotected boolean canDespawn()
canDespawn in class EntityLivingprotected SoundEvent getAmbientSound()
getAmbientSound in class EntityLivingprotected SoundEvent getHurtSound(DamageSource damageSourceIn)
getHurtSound in class EntityLivingBaseprotected SoundEvent getDeathSound()
getDeathSound in class EntityLivingBaseprotected ResourceLocation getLootTable()
getLootTable in class EntityLivingpublic void setProfession(int professionId)
@Deprecated public int getProfession()
public void setProfession(VillagerRegistry.VillagerProfession prof)
public VillagerRegistry.VillagerProfession getProfessionForge()
public void notifyDataManagerChange(DataParameter<?> key)
notifyDataManagerChange in class EntityAgeablepublic boolean isMating()
public void setMating(boolean mating)
public void setPlaying(boolean playing)
public boolean isPlaying()
public void setRevengeTarget(EntityLivingBase livingBase)
setRevengeTarget in class EntityLivingBasepublic void onDeath(DamageSource cause)
onDeath in class EntityLivingBasepublic void setCustomer(EntityPlayer player)
setCustomer in interface IMerchantpublic EntityPlayer getCustomer()
getCustomer in interface IMerchantpublic boolean isTrading()
public boolean getIsWillingToMate(boolean updateFirst)
isWillingToMatepublic void setIsWillingToMate(boolean isWillingToMate)
public void useRecipe(MerchantRecipe recipe)
public void verifySellingItem(ItemStack stack)
verifySellingItem in interface IMerchantpublic MerchantRecipeList getRecipes(EntityPlayer player)
getRecipes in interface IMerchantpublic void setRecipes(MerchantRecipeList recipeList)
setRecipes in interface IMerchantpublic ITextComponent getDisplayName()
getDisplayName in interface ICommandSendergetDisplayName in interface IMerchantgetDisplayName in class Entitypublic float getEyeHeight()
getEyeHeight in class Entitypublic void handleStatusUpdate(byte id)
handleStatusUpdate in class EntityLivingpublic IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata)
onInitialSpawn in class EntityLivingpublic IEntityLivingData finalizeMobSpawn(DifficultyInstance p_190672_1_, IEntityLivingData p_190672_2_, boolean p_190672_3_)
public void setLookingForHome()
public EntityVillager createChild(EntityAgeable ageable)
createChild in class EntityAgeablepublic boolean canBeLeashedTo(EntityPlayer player)
canBeLeashedTo in class EntityLivingpublic void onStruckByLightning(EntityLightningBolt lightningBolt)
onStruckByLightning in class Entitypublic InventoryBasic getVillagerInventory()
protected void updateEquipmentIfNeeded(EntityItem itemEntity)
updateEquipmentIfNeeded in class EntityLivingpublic boolean hasEnoughFoodToBreed()
public boolean canAbondonItems()
EntityAIVillagerInteract to check if the
villager can give some items from an inventory to another villager.public boolean wantsMoreFood()
public boolean isFarmItemInInventory()
public boolean replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn)
replaceItemInInventory in class EntityLiving@Deprecated public static EntityVillager.ITradeList[][][][] GET_TRADES_DONT_USE()