Class EntityVillager

  • All Implemented Interfaces:
    IMerchant, INpc, IAnimals, org.teavm.jso.JSObject

    public class EntityVillager
    extends EntityAgeable
    implements IMerchant, INpc
    + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
    • Constructor Detail

      • EntityVillager

        public EntityVillager​(World worldIn)
      • EntityVillager

        public EntityVillager​(World worldIn,
                              int professionId)
    • Method Detail

      • bootstrap

        public static void bootstrap()
      • interact

        public boolean interact​(EntityPlayer entityplayer)
        + Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
        Overrides:
        interact in class EntityAgeable
      • canDespawn

        protected boolean canDespawn()
        + Determines if an entity can be despawned, used on idle far away entities
        Overrides:
        canDespawn in class EntityLiving
      • getLivingSound

        protected java.lang.String getLivingSound()
        + Returns the sound this mob makes while it's alive.
        Overrides:
        getLivingSound in class EntityLiving
      • getHurtSound

        protected java.lang.String getHurtSound()
        + Returns the sound this mob makes when it is hurt.
        Overrides:
        getHurtSound in class EntityLivingBase
      • getDeathSound

        protected java.lang.String getDeathSound()
        + Returns the sound this mob makes on death.
        Overrides:
        getDeathSound in class EntityLivingBase
      • setProfession

        public void setProfession​(int professionId)
      • getProfession

        public int getProfession()
      • isMating

        public boolean isMating()
      • setMating

        public void setMating​(boolean mating)
      • setPlaying

        public void setPlaying​(boolean playing)
      • isPlaying

        public boolean isPlaying()
      • isTrading

        public boolean isTrading()
      • getIsWillingToMate

        public boolean getIsWillingToMate​(boolean updateFirst)
        + Returns current or updated value of isWillingToMate
      • setIsWillingToMate

        public void setIsWillingToMate​(boolean willingToTrade)
      • verifySellingItem

        public void verifySellingItem​(ItemStack itemstack)
        + Notifies the merchant of a possible merchantrecipe being fulfilled or not. Usually, this is just a sound byte being played depending if the suggested itemstack is not null.
        Specified by:
        verifySellingItem in interface IMerchant
      • onInitialSpawn

        public IEntityLivingData onInitialSpawn​(DifficultyInstance difficultyinstance,
                                                IEntityLivingData ientitylivingdata)
        + 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. Mainly used for initializing attributes and inventory
        Overrides:
        onInitialSpawn in class EntityLiving
      • setLookingForHome

        public void setLookingForHome()
      • updateEquipmentIfNeeded

        protected void updateEquipmentIfNeeded​(EntityItem entityitem)
        + Tests if this entity should pickup a weapon or an armor. Entity drops current weapon or armor if the new one is better.
        Overrides:
        updateEquipmentIfNeeded in class EntityLiving
      • func_175553_cp

        public boolean func_175553_cp()
      • canAbondonItems

        public boolean canAbondonItems()
        + Used by EntityAIVillagerInteract to check if the villager can give some items from an inventory to another villager.
      • func_175557_cr

        public boolean func_175557_cr()
      • isFarmItemInInventory

        public boolean isFarmItemInInventory()
        + Returns true if villager has seeds, potatoes or carrots in inventory