net.minecraft.entity.passive

## Class EntityPig

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.EntityLivingBase
    - - net.minecraft.entity.EntityLiving
      - - net.minecraft.entity.EntityCreature
        - - net.minecraft.entity.EntityAgeable
          - - net.minecraft.entity.passive.EntityAnimal
            - - net.minecraft.entity.passive.EntityPig

- All Implemented Interfaces:
    IAnimals

      public class EntityPig
      extends EntityAnimal

- - ### Field Summary

    - ### Fields inherited from class net.minecraft.entity.passive.EntityAnimal

      `inLove`

    - ### Fields inherited from class net.minecraft.entity.EntityCreature

      `field_110179_h, field_110181_i`

    - ### Fields inherited from class net.minecraft.entity.EntityLiving

      `experienceValue, livingSoundTime, targetTasks, tasks`

    - ### Fields inherited from class net.minecraft.entity.EntityLivingBase

      `arrowHitTimer, attackedAtYaw, attackTime, cameraPitch, deathTime, field_70769_ao, field_70770_ap, hurtTime, isSwingInProgress, jumpMovementFactor, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, renderYawOffset, rotationYawHead, swingProgress, swingProgressInt`

    - ### Fields inherited from class net.minecraft.entity.Entity

      `addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityPig(World par1World)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canBeSteered()` returns true if all the conditions for steering the entity are met.
    `EntityAgeable` | `createChild(EntityAgeable par1EntityAgeable)`
    `EntityAIControlledByPlayer` | `getAIControlledByPlayer()` Return the AI task for player control.
    `boolean` | `getSaddled()` Returns true if the pig is saddled.
    `boolean` | `interact(EntityPlayer par1EntityPlayer)` Called when a player interacts with a mob.
    `boolean` | `isAIEnabled()` Returns true if the newer Entity AI code should be run
    `boolean` | `isBreedingItem(ItemStack par1ItemStack)` Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type)
    `void` | `onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)` Called when a lightning bolt hits the entity.
    `void` | `readEntityFromNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to read subclass entity data from NBT.
    `void` | `setSaddled(boolean par1)` Set or remove the saddle of the pig.
    `EntityPig` | `spawnBabyAnimal(EntityAgeable par1EntityAgeable)` This function is used when two same-species animals in 'love mode' breed to generate the new baby animal.
    `void` | `writeEntityToNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to write subclass entity data to NBT.

    - ### Methods inherited from class net.minecraft.entity.passive.EntityAnimal

      `attackEntityFrom, canMateWith, func_110196_bT, getBlockPathWeight, getCanSpawnHere, getTalkInterval, handleHealthUpdate, isInLove, onLivingUpdate, resetInLove`

    - ### Methods inherited from class net.minecraft.entity.EntityAgeable

      `addGrowth, getGrowingAge, isChild, setGrowingAge, setScaleForAge`

    - ### Methods inherited from class net.minecraft.entity.EntityCreature

      `detachHome, func_110173_bK, func_110174_bM, func_110176_b, getEntityToAttack, getHomePosition, hasHome, hasPath, setHomeArea, setPathToEntity, setTarget`

    - ### Methods inherited from class net.minecraft.entity.EntityLiving

      `allowLeashing, canAttackClass, canPickUpLoot, clearLeashed, eatGrassBonus, faceEntity, func_110163_bv, func_130225_q, getAlwaysRenderNameTag, getAlwaysRenderNameTagForRender, getArmorItemForSlot, getArmorPosition, getAttackTarget, getCurrentItemOrArmor, getCustomNameTag, getEntityName, getEntitySenses, getHeldItem, getJumpHelper, getLastActiveItems, getLeashed, getLeashedToEntity, getLookHelper, getMaxSafePointTries, getMaxSpawnedInChunk, getMoveHelper, getNavigator, getRenderSizeModifier, getVerticalFaceSpeed, hasCustomNameTag, interactFirst, isNoDespawnRequired, onEntityUpdate, onSpawnWithEgg, onUpdate, playLivingSound, setAIMoveSpeed, setAlwaysRenderNameTag, setAttackTarget, setCanPickUpLoot, setCurrentItemOrArmor, setCustomNameTag, setEquipmentDropChance, setLeashedToEntity, setMoveForward, spawnExplosionParticle`

    - ### Methods inherited from class net.minecraft.entity.EntityLivingBase

      `addPotionEffect, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, clearActivePotions, curePotionEffects, dismountEntity, func_110142_aN, func_142015_aE, func_94060_bK, getAbsorptionAmount, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getEntityAttribute, getEyeHeight, getHealth, getItemIcon, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getPosition, getRNG, getRotationYawHead, getSwingProgress, getTeam, getTotalArmorValue, heal, isClientWorld, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPlayerSleeping, isPotionActive, isPotionActive, isPotionApplicable, knockBack, moveEntityWithHeading, onDeath, onItemPickup, performHurtAnimation, rayTrace, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAbsorptionAmount, setArrowCountInEntity, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, swingItem, updateRidden`

    - ### Methods inherited from class net.minecraft.entity.Entity

      `addEntityCrashInfo, addToPlayerScore, addVelocity, applyEntityCollision, canAttackWithItem, canRenderOnFire, canRiderInteract, copyDataFrom, copyLocationAndAnglesFrom, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAir, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getExtendedProperties, getMaxInPortalTime, getMountedYOffset, getParts, getPersistentID, getPickedResult, getPortalCooldown, getShadowSize, getTeleportDirection, getTranslatedEntityName, getUniqueID, getYOffset, handleLavaMovement, handleWaterMovement, hashCode, hitByEntity, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSneaking, isSprinting, isWet, mountEntity, moveEntity, moveFlying, onChunkLoad, onCollideWithPlayer, onKillEntity, playSound, readFromNBT, registerExtendedProperties, resetEntityId, setAir, setAngles, setDead, setEating, setFire, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setPosition, setPositionAndRotation, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldExplodeBlock, shouldRenderInPass, shouldRiderSit, toString, travelToDimension, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EntityPig

          public EntityPig(World par1World)

  - ### Method Detail

    - #### isAIEnabled

          public boolean isAIEnabled()

      Returns true if the newer Entity AI code should be run

    - #### canBeSteered

          public boolean canBeSteered()

      returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by a player and the player is holding a carrot-on-a-stick
      Overrides:
        `canBeSteered` in class `EntityLiving`

    - #### writeEntityToNBT

          public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to write subclass entity data to NBT.
      Overrides:
        `writeEntityToNBT` in class `EntityAnimal`

    - #### readEntityFromNBT

          public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
        `readEntityFromNBT` in class `EntityAnimal`

    - #### interact

          public boolean interact(EntityPlayer par1EntityPlayer)

      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 `EntityAnimal`

    - #### getSaddled

          public boolean getSaddled()

      Returns true if the pig is saddled.

    - #### setSaddled

          public void setSaddled(boolean par1)

      Set or remove the saddle of the pig.

    - #### onStruckByLightning

          public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)

      Called when a lightning bolt hits the entity.
      Overrides:
        `onStruckByLightning` in class `Entity`

    - #### spawnBabyAnimal

          public EntityPig spawnBabyAnimal(EntityAgeable par1EntityAgeable)

      This function is used when two same-species animals in 'love mode' breed to generate the new baby animal.

    - #### isBreedingItem

          public boolean isBreedingItem(ItemStack par1ItemStack)

      Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type)
      Overrides:
        `isBreedingItem` in class `EntityAnimal`

    - #### getAIControlledByPlayer

          public EntityAIControlledByPlayer getAIControlledByPlayer()

      Return the AI task for player control.

    - #### createChild

          public EntityAgeable createChild(EntityAgeable par1EntityAgeable)

      Specified by:
        `createChild` in class `EntityAgeable`