net.minecraft.tileentity

## Class TileEntity

- java.lang.Object
- - net.minecraft.tileentity.TileEntity

- Direct Known Subclasses:
    BlockJukebox.TileEntityJukebox, TileEntityBeacon, TileEntityBrewingStand, TileEntityChest, TileEntityCommandBlock, TileEntityComparator, TileEntityDaylightDetector, TileEntityDispenser, TileEntityEnchantmentTable, TileEntityEnderChest, TileEntityEndPortal, TileEntityFlowerPot, TileEntityFurnace, TileEntityHopper, TileEntityMobSpawner, TileEntityNote, TileEntityPiston, TileEntitySign, TileEntitySkull, TileFluidHandler

      public class TileEntity
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `blockMetadata`
    `Block` | `blockType`
    `static AxisAlignedBB` | `INFINITE_EXTENT_AABB` Sometimes default render bounding box: infinite in scope.
    `protected boolean` | `tileEntityInvalid`
    `protected World` | `worldObj`
    `int` | `xCoord`
    `int` | `yCoord`
    `int` | `zCoord`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TileEntity()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addMapping(java.lang.Class p_145826_0_, java.lang.String p_145826_1_)`
    `boolean` | `canUpdate()` Determines if this TileEntity requires update calls.
    `static TileEntity` | `createAndLoadEntity(NBTTagCompound p_145827_0_)`
    `void` | `func_145828_a(CrashReportCategory p_145828_1_)`
    `int` | `getBlockMetadata()`
    `Block` | `getBlockType()`
    `Packet` | `getDescriptionPacket()`
    `double` | `getDistanceFrom(double p_145835_1_, double p_145835_3_, double p_145835_5_)`
    `double` | `getMaxRenderDistanceSquared()`
    `AxisAlignedBB` | `getRenderBoundingBox()` Return an `AxisAlignedBB` that controls the visible scope of a `TileEntitySpecialRenderer` associated with this `TileEntity` Defaults to the collision bounding box `Block.getCollisionBoundingBoxFromPool(World, int, int, int)` associated with the block at this location.
    `World` | `getWorldObj()`
    `boolean` | `hasWorldObj()`
    `void` | `invalidate()`
    `boolean` | `isInvalid()`
    `void` | `markDirty()`
    `void` | `onChunkUnload()` Called when the chunk this TileEntity is on is Unloaded.
    `void` | `onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)` Called when you receive a TileEntityData packet for the location this TileEntity is currently in.
    `void` | `readFromNBT(NBTTagCompound p_145839_1_)`
    `boolean` | `receiveClientEvent(int p_145842_1_, int p_145842_2_)`
    `void` | `setWorldObj(World p_145834_1_)`
    `boolean` | `shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z)` Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes.
    `boolean` | `shouldRenderInPass(int pass)`
    `void` | `updateContainingBlockInfo()`
    `void` | `updateEntity()`
    `void` | `validate()`
    `void` | `writeToNBT(NBTTagCompound p_145841_1_)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### worldObj

          protected World worldObj

    - #### xCoord

          public int xCoord

    - #### yCoord

          public int yCoord

    - #### zCoord

          public int zCoord

    - #### tileEntityInvalid

          protected boolean tileEntityInvalid

    - #### blockMetadata

          public int blockMetadata

    - #### blockType

          public Block blockType

    - #### INFINITE_EXTENT_AABB

          public static final AxisAlignedBB INFINITE_EXTENT_AABB

      Sometimes default render bounding box: infinite in scope. Used to control rendering on `TileEntitySpecialRenderer`.

  - ### Constructor Detail

    - #### TileEntity

          public TileEntity()

  - ### Method Detail

    - #### addMapping

          public static void addMapping(java.lang.Class p_145826_0_,
                        java.lang.String p_145826_1_)

    - #### getWorldObj

          public World getWorldObj()

    - #### setWorldObj

          public void setWorldObj(World p_145834_1_)

    - #### hasWorldObj

          public boolean hasWorldObj()

    - #### readFromNBT

          public void readFromNBT(NBTTagCompound p_145839_1_)

    - #### writeToNBT

          public void writeToNBT(NBTTagCompound p_145841_1_)

    - #### updateEntity

          public void updateEntity()

    - #### createAndLoadEntity

          public static TileEntity createAndLoadEntity(NBTTagCompound p_145827_0_)

    - #### getBlockMetadata

          public int getBlockMetadata()

    - #### markDirty

          public void markDirty()

    - #### getDistanceFrom

          public double getDistanceFrom(double p_145835_1_,
                               double p_145835_3_,
                               double p_145835_5_)

    - #### getMaxRenderDistanceSquared

          public double getMaxRenderDistanceSquared()

    - #### getBlockType

          public Block getBlockType()

    - #### getDescriptionPacket

          public Packet getDescriptionPacket()

    - #### isInvalid

          public boolean isInvalid()

    - #### invalidate

          public void invalidate()

    - #### validate

          public void validate()

    - #### receiveClientEvent

          public boolean receiveClientEvent(int p_145842_1_,
                                   int p_145842_2_)

    - #### updateContainingBlockInfo

          public void updateContainingBlockInfo()

    - #### func_145828_a

          public void func_145828_a(CrashReportCategory p_145828_1_)

    - #### canUpdate

          public boolean canUpdate()

      Determines if this TileEntity requires update calls.
      Returns:
        True if you want updateEntity() to be called, false if not

    - #### onDataPacket

          public void onDataPacket(NetworkManager net,
                          S35PacketUpdateTileEntity pkt)

      Called when you receive a TileEntityData packet for the location this TileEntity is currently in. On the client, the NetworkManager will always be the remote server. On the server, it will be whomever is responsible for sending the packet.
      Parameters:
        `net` - The NetworkManager the packet originated from
        `pkt` - The data packet

    - #### onChunkUnload

          public void onChunkUnload()

      Called when the chunk this TileEntity is on is Unloaded.

    - #### shouldRefresh

          public boolean shouldRefresh(Block oldBlock,
                              Block newBlock,
                              int oldMeta,
                              int newMeta,
                              World world,
                              int x,
                              int y,
                              int z)

      Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes. Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly.
      Parameters:
        `oldID` - The old ID of the block
        `newID` - The new ID of the block (May be the same)
        `oldMeta` - The old metadata of the block
        `newMeta` - The new metadata of the block (May be the same)
        `world` - Current world
        `x` - X Position
        `y` - Y Position
        `z` - Z Position
      Returns:
        True to remove the old tile entity, false to keep it in tact {and create a new one if the new values specify to}

    - #### shouldRenderInPass

          public boolean shouldRenderInPass(int pass)

    - #### getRenderBoundingBox

          public AxisAlignedBB getRenderBoundingBox()

      Return an `AxisAlignedBB` that controls the visible scope of a `TileEntitySpecialRenderer` associated with this `TileEntity` Defaults to the collision bounding box `Block.getCollisionBoundingBoxFromPool(World, int, int, int)` associated with the block at this location.
      Returns:
        an appropriately size `AxisAlignedBB` for the `TileEntity`