net.minecraft.entity

## Class EntityHanging

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.EntityHanging

- Direct Known Subclasses:
    EntityItemFrame, EntityLeashKnot, EntityPainting

      public abstract class EntityHanging
      extends Entity

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `hangingDirection`
    `int` | `xPosition`
    `int` | `yPosition`
    `int` | `zPosition`

    - ### 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
    `EntityHanging(World par1World)`
    `EntityHanging(World par1World, int par2, int par3, int par4, int par5)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addVelocity(double par1, double par3, double par5)` Adds to the current velocity of the entity.
    `boolean` | `attackEntityFrom(DamageSource par1DamageSource, float par2)` Called when the entity is attacked.
    `boolean` | `canBeCollidedWith()` Returns true if other Entities should be prevented from moving through this Entity.
    `abstract int` | `getHeightPixels()`
    `abstract int` | `getWidthPixels()`
    `boolean` | `hitByEntity(Entity par1Entity)` Called when a player attacks an entity.
    `void` | `moveEntity(double par1, double par3, double par5)` Tries to moves the entity by the passed in displacement.
    `abstract void` | `onBroken(Entity entity)` Called when this entity is broken.
    `void` | `onUpdate()` Called to update the entity's position/logic.
    `boolean` | `onValidSurface()` checks to make sure painting can be placed there
    `void` | `readEntityFromNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to read subclass entity data from NBT.
    `void` | `setDirection(int par1)`
    `void` | `writeEntityToNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to write subclass entity data to NBT.

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

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

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

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

- - ### Field Detail

    - #### hangingDirection

          public int hangingDirection

    - #### xPosition

          public int xPosition

    - #### yPosition

          public int yPosition

    - #### zPosition

          public int zPosition

  - ### Constructor Detail

    - #### EntityHanging

          public EntityHanging(World par1World)

    - #### EntityHanging

          public EntityHanging(World par1World,
                       int par2,
                       int par3,
                       int par4,
                       int par5)

  - ### Method Detail

    - #### setDirection

          public void setDirection(int par1)

    - #### onUpdate

          public void onUpdate()

      Called to update the entity's position/logic.
      Overrides:
        `onUpdate` in class `Entity`

    - #### onValidSurface

          public boolean onValidSurface()

      checks to make sure painting can be placed there

    - #### canBeCollidedWith

          public boolean canBeCollidedWith()

      Returns true if other Entities should be prevented from moving through this Entity.
      Overrides:
        `canBeCollidedWith` in class `Entity`

    - #### hitByEntity

          public boolean hitByEntity(Entity par1Entity)

      Called when a player attacks an entity. If this returns true the attack will not happen.
      Overrides:
        `hitByEntity` in class `Entity`

    - #### attackEntityFrom

          public boolean attackEntityFrom(DamageSource par1DamageSource,
                                 float par2)

      Called when the entity is attacked.
      Overrides:
        `attackEntityFrom` in class `Entity`

    - #### moveEntity

          public void moveEntity(double par1,
                        double par3,
                        double par5)

      Tries to moves the entity by the passed in displacement. Args: x, y, z
      Overrides:
        `moveEntity` in class `Entity`

    - #### addVelocity

          public void addVelocity(double par1,
                         double par3,
                         double par5)

      Adds to the current velocity of the entity. Args: x, y, z
      Overrides:
        `addVelocity` in class `Entity`

    - #### writeEntityToNBT

          public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to write subclass entity data to NBT.

    - #### readEntityFromNBT

          public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to read subclass entity data from NBT.

    - #### getWidthPixels

          public abstract int getWidthPixels()

    - #### getHeightPixels

          public abstract int getHeightPixels()

    - #### onBroken

          public abstract void onBroken(Entity entity)

      Called when this entity is broken. Entity parameter may be null.