net.minecraft.tileentity

## Class TileEntityCommandBlock

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

- All Implemented Interfaces:
    ICommandSender

      public class TileEntityCommandBlock
      extends TileEntity
      implements ICommandSender

- - ### Field Summary

    - ### Fields inherited from class net.minecraft.tileentity.TileEntity

      `blockMetadata, blockType, INFINITE_EXTENT_AABB, worldObj, xCoord, yCoord, zCoord`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TileEntityCommandBlock()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canCommandSenderUseCommand(int par1, String par2Str)` Returns true if the command sender is allowed to use the given command.
    `int` | `executeCommandOnPowered(World par1World)` Execute the command, called when the command block is powered.
    `String` | `getCommand()`
    `String` | `getCommandSenderName()` Gets the name of this command sender (usually username, but possibly "Rcon")
    `Packet` | `getDescriptionPacket()` Overriden in a sign to provide the text.
    `World` | `getEntityWorld()`
    `ChunkCoordinates` | `getPlayerCoordinates()` Return the position for this command sender.
    `int` | `getSignalStrength()`
    `void` | `readFromNBT(NBTTagCompound par1NBTTagCompound)` Reads a tile entity from NBT.
    `void` | `sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)`
    `void` | `setCommand(String par1Str)` Sets the command this block will execute when powered.
    `void` | `setCommandSenderName(String par1Str)` Sets the name of the command sender
    `void` | `setSignalStrength(int par1)`
    `void` | `writeToNBT(NBTTagCompound par1NBTTagCompound)` Writes a tile entity to NBT.

    - ### Methods inherited from class net.minecraft.tileentity.TileEntity

      `addMapping, canUpdate, createAndLoadEntity, func_85027_a, getBlockMetadata, getBlockType, getDistanceFrom, getMaxRenderDistanceSquared, getRenderBoundingBox, getWorldObj, hasWorldObj, invalidate, isInvalid, onChunkUnload, onDataPacket, onInventoryChanged, receiveClientEvent, setWorldObj, shouldRefresh, shouldRenderInPass, updateContainingBlockInfo, updateEntity, validate`

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

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

- - ### Constructor Detail

    - #### TileEntityCommandBlock

          public TileEntityCommandBlock()

  - ### Method Detail

    - #### setCommand

          public void setCommand(String par1Str)

      Sets the command this block will execute when powered.

    - #### executeCommandOnPowered

          public int executeCommandOnPowered(World par1World)

      Execute the command, called when the command block is powered.

    - #### getCommand

          public String getCommand()

    - #### getCommandSenderName

          public String getCommandSenderName()

      Gets the name of this command sender (usually username, but possibly "Rcon")
      Specified by:
        `getCommandSenderName` in interface `ICommandSender`

    - #### setCommandSenderName

          public void setCommandSenderName(String par1Str)

      Sets the name of the command sender

    - #### sendChatToPlayer

          public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)

      Specified by:
        `sendChatToPlayer` in interface `ICommandSender`

    - #### canCommandSenderUseCommand

          public boolean canCommandSenderUseCommand(int par1,
                                           String par2Str)

      Returns true if the command sender is allowed to use the given command.
      Specified by:
        `canCommandSenderUseCommand` in interface `ICommandSender`

    - #### writeToNBT

          public void writeToNBT(NBTTagCompound par1NBTTagCompound)

      Writes a tile entity to NBT.
      Overrides:
        `writeToNBT` in class `TileEntity`

    - #### readFromNBT

          public void readFromNBT(NBTTagCompound par1NBTTagCompound)

      Reads a tile entity from NBT.
      Overrides:
        `readFromNBT` in class `TileEntity`

    - #### getPlayerCoordinates

          public ChunkCoordinates getPlayerCoordinates()

      Return the position for this command sender.
      Specified by:
        `getPlayerCoordinates` in interface `ICommandSender`

    - #### getEntityWorld

          public World getEntityWorld()

      Specified by:
        `getEntityWorld` in interface `ICommandSender`

    - #### getDescriptionPacket

          public Packet getDescriptionPacket()

      Overriden in a sign to provide the text.
      Overrides:
        `getDescriptionPacket` in class `TileEntity`

    - #### getSignalStrength

          public int getSignalStrength()

    - #### setSignalStrength

          public void setSignalStrength(int par1)