public class EntityVillager extends EntityAgeable implements IMerchant, INpc
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
EntityVillager.EmeraldForItems |
(package private) static class |
EntityVillager.ItemAndEmeraldToItem |
(package private) static interface |
EntityVillager.ITradeList |
(package private) static class |
EntityVillager.ListEnchantedBookForEmeralds |
(package private) static class |
EntityVillager.ListEnchantedItemForEmeralds |
(package private) static class |
EntityVillager.ListItemForEmeralds |
(package private) static class |
EntityVillager.PriceInfo |
EntityLiving.SpawnPlacementType| Modifier and Type | Field and Description |
|---|---|
private boolean |
areAdditionalTasksSet |
private MerchantRecipeList |
buyingList
Initialises the MerchantRecipeList.java
|
private EntityPlayer |
buyingPlayer
This villager's current customer.
|
private int |
careerId |
private int |
careerLevel
This is the EntityVillager's career level value
|
private static EntityVillager.ITradeList[][][][] |
DEFAULT_TRADE_LIST_MAP
A multi-dimensional array mapping the various professions, careers and career levels that a Villager may offer
|
private boolean |
isLookingForHome |
private boolean |
isMating |
private boolean |
isPlaying |
private boolean |
isWillingToMate |
private java.lang.String |
lastBuyingPlayer
Last player to trade with this villager, used for aggressivity.
|
private boolean |
needsInitilization
addDefaultEquipmentAndRecipies is called if this is true
|
private int |
randomTickDivider |
private int |
timeUntilReset |
(package private) Village |
villageObj |
private InventoryBasic |
villagerInventory |
private int |
wealth |
field_175502_b, field_175503_c, growingAgeFLEEING_SPEED_MODIFIER, FLEEING_SPEED_MODIFIER_UUIDequipmentDropChances, experienceValue, jumpHelper, livingSoundTime, moveHelper, navigator, targetTasks, tasksarrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, field_70741_aB, field_70769_ao, field_70770_ap, hurtTime, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingProgress, swingProgressIntaddedToChunk, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, field_181016_an, field_181017_ao, field_181018_ap, fireResistance, firstUpdate, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj| Constructor and Description |
|---|
EntityVillager(World worldIn) |
EntityVillager(World worldIn,
int professionId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowLeashing() |
protected void |
applyEntityAttributes() |
boolean |
canAbondonItems()
Used by
EntityAIVillagerInteract to check if the
villager can give some items from an inventory to another villager. |
protected boolean |
canDespawn()
Determines if an entity can be despawned, used on idle far away entities
|
private boolean |
canVillagerPickupItem(Item itemIn) |
EntityVillager |
createChild(EntityAgeable ageable) |
protected void |
entityInit() |
boolean |
func_175553_cp() |
boolean |
func_175557_cr() |
EntityPlayer |
getCustomer() |
protected java.lang.String |
getDeathSound()
Returns the sound this mob makes on death.
|
IChatComponent |
getDisplayName()
Get the formatted ChatComponent that will be used for the sender's username in chat
|
float |
getEyeHeight() |
protected java.lang.String |
getHurtSound()
Returns the sound this mob makes when it is hurt.
|
boolean |
getIsWillingToMate(boolean updateFirst)
Returns current or updated value of
isWillingToMate |
protected java.lang.String |
getLivingSound()
Returns the sound this mob makes while it's alive.
|
int |
getProfession() |
MerchantRecipeList |
getRecipes(EntityPlayer p_70934_1_) |
InventoryBasic |
getVillagerInventory() |
void |
handleStatusUpdate(byte id) |
private boolean |
hasEnoughItems(int multiplier)
Returns true if villager has enough items in inventory
|
boolean |
interact(EntityPlayer player)
Called when a player interacts with a mob.
|
boolean |
isFarmItemInInventory()
Returns true if villager has seeds, potatoes or carrots in inventory
|
boolean |
isMating() |
boolean |
isPlaying() |
boolean |
isTrading() |
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.
|
private void |
populateBuyingList() |
void |
readEntityFromNBT(NBTTagCompound tagCompund)
(abstract) Protected helper method to read subclass entity data from NBT.
|
boolean |
replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn) |
private void |
setAdditionalAItasks() |
void |
setCustomer(EntityPlayer p_70932_1_) |
void |
setIsWillingToMate(boolean willingToTrade) |
void |
setLookingForHome() |
void |
setMating(boolean mating) |
void |
setPlaying(boolean playing) |
void |
setProfession(int professionId) |
void |
setRecipes(MerchantRecipeList recipeList) |
void |
setRevengeTarget(EntityLivingBase livingBase) |
private void |
spawnParticles(EnumParticleTypes particleType) |
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.
|
void |
writeEntityToNBT(NBTTagCompound tagCompound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addGrowth, func_175501_a, getGrowingAge, isChild, onLivingUpdate, setGrowingAge, setScale, setScaleForAge, setSizedetachHome, func_142017_o, getBlockPathWeight, getCanSpawnHere, getHomePosition, getMaximumHomeDistance, hasHome, hasPath, isWithinHomeDistanceCurrentPosition, isWithinHomeDistanceFromPosition, setHomePosAndDistance, updateLeashedStatecanAttackClass, canBeSteered, canPickUpLoot, clearLeashed, despawnEntity, dropEquipment, dropFewItems, eatGrassBonus, enablePersistence, faceEntity, func_110146_f, func_175448_a, getArmorItemForSlot, getArmorPosition, getAttackTarget, getCurrentArmor, getDropItem, getEntitySenses, getEquipmentInSlot, getExperiencePoints, getHeldItem, getInventory, getJumpHelper, getLeashed, getLeashedToEntity, getLookHelper, getMaxFallHeight, getMaxSpawnedInChunk, getMoveHelper, getNavigator, getNewNavigator, getRenderSizeModifier, getTalkInterval, getVerticalFaceSpeed, interactFirst, isAIDisabled, isNoDespawnRequired, isNotColliding, isServerWorld, onEntityUpdate, onUpdate, playLivingSound, setAIMoveSpeed, setAttackTarget, setCanPickUpLoot, setCurrentItemOrArmor, setEnchantmentBasedOnDifficulty, setEquipmentBasedOnDifficulty, setEquipmentDropChance, setLeashedToEntity, setMoveForward, setNoAI, spawnExplosionParticle, updateEntityActionStateaddPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, attackEntityFrom, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, damageArmor, damageEntity, decreaseAirSupply, dismountEntity, fall, func_181013_g, func_94060_bK, getAbsorptionAmount, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getFallSoundString, getHealth, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, getTeam, getTotalArmorValue, handleJumpLava, heal, isEntityAlive, isEntityUndead, isMovementBlocked, isOnLadder, isOnSameTeam, isOnTeam, isPlayer, isPlayerSleeping, isPotionActive, isPotionActive, isPotionApplicable, jump, kill, knockBack, markPotionsDirty, mountEntity, moveEntityWithHeading, onChangedPotionEffect, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onNewPotionEffect, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRotationYawHead, setSprinting, swingItem, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata, updateRiddenaddChatMessage, addEntityCrashInfo, addToPlayerScore, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canCommandSenderUseCommand, canRenderOnFire, canTriggerWalking, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_174817_o, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getCustomNameTag, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getFlag, getHorizontalFacing, getHoverEvent, getMaxInPortalTime, getMountedYOffset, getName, getNBTTagCompound, getParts, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getSplashSound, getSwimSound, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCustomName, hashCode, hitByEntity, interactAt, isBurning, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isPushedByWater, isRiding, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onKillEntity, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, resetHeight, sendCommandFeedback, setAir, setAlwaysRenderNameTag, setAngles, setCommandStat, setCustomNameTag, setDead, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptionalprivate int randomTickDivider
private boolean isMating
private boolean isPlaying
Village villageObj
private EntityPlayer buyingPlayer
private MerchantRecipeList buyingList
private int timeUntilReset
private boolean needsInitilization
private boolean isWillingToMate
private int wealth
private java.lang.String lastBuyingPlayer
private int careerId
private int careerLevel
private boolean isLookingForHome
private boolean areAdditionalTasksSet
private InventoryBasic villagerInventory
private static final EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP
public EntityVillager(World worldIn)
public EntityVillager(World worldIn, int professionId)
private void setAdditionalAItasks()
protected void onGrowingAdult()
onGrowingAdult in class EntityAgeableprotected void applyEntityAttributes()
applyEntityAttributes in class EntityLivingprotected void updateAITasks()
updateAITasks in class EntityLivingpublic boolean interact(EntityPlayer player)
interact in class EntityAgeableprotected void entityInit()
entityInit in class EntityAgeablepublic void writeEntityToNBT(NBTTagCompound tagCompound)
writeEntityToNBT in class EntityAgeablepublic void readEntityFromNBT(NBTTagCompound tagCompund)
readEntityFromNBT in class EntityAgeableprotected boolean canDespawn()
canDespawn in class EntityLivingprotected java.lang.String getLivingSound()
getLivingSound in class EntityLivingprotected java.lang.String getHurtSound()
getHurtSound in class EntityLivingBaseprotected java.lang.String getDeathSound()
getDeathSound in class EntityLivingBasepublic void setProfession(int professionId)
public int getProfession()
public 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 p_70932_1_)
setCustomer in interface IMerchantpublic EntityPlayer getCustomer()
getCustomer in interface IMerchantpublic boolean isTrading()
public boolean getIsWillingToMate(boolean updateFirst)
isWillingToMatepublic void setIsWillingToMate(boolean willingToTrade)
public void useRecipe(MerchantRecipe recipe)
public void verifySellingItem(ItemStack stack)
verifySellingItem in interface IMerchantpublic MerchantRecipeList getRecipes(EntityPlayer p_70934_1_)
getRecipes in interface IMerchantprivate void populateBuyingList()
public void setRecipes(MerchantRecipeList recipeList)
setRecipes in interface IMerchantpublic IChatComponent getDisplayName()
getDisplayName in interface ICommandSendergetDisplayName in interface IMerchantgetDisplayName in class Entitypublic float getEyeHeight()
getEyeHeight in class Entitypublic void handleStatusUpdate(byte id)
handleStatusUpdate in class EntityLivingprivate void spawnParticles(EnumParticleTypes particleType)
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata)
onInitialSpawn in class EntityLivingpublic void setLookingForHome()
public EntityVillager createChild(EntityAgeable ageable)
createChild in class EntityAgeablepublic boolean allowLeashing()
allowLeashing in class EntityLivingpublic void onStruckByLightning(EntityLightningBolt lightningBolt)
onStruckByLightning in class Entitypublic InventoryBasic getVillagerInventory()
protected void updateEquipmentIfNeeded(EntityItem itemEntity)
updateEquipmentIfNeeded in class EntityLivingprivate boolean canVillagerPickupItem(Item itemIn)
public boolean func_175553_cp()
public boolean canAbondonItems()
EntityAIVillagerInteract to check if the
villager can give some items from an inventory to another villager.public boolean func_175557_cr()
private boolean hasEnoughItems(int multiplier)
public boolean isFarmItemInInventory()
public boolean replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn)
replaceItemInInventory in class EntityLiving