public interface TileEntity extends DataHolder, DataSerializable
A TileEntity
is contained within a Location
and will
continue to exists so long as the Location
is of the correct
block type.
Since a TileEntity
is performing various actions, all methods
that are purely functional methods reside in the TileEntity
, whereas
customizable data associated with a TileEntity
is represented by
DataManipulator
.
Modifier and Type | Method and Description |
---|---|
BlockState |
getBlock()
Gets the
BlockState that this TileEntity represents. |
Location<World> |
getLocation()
Gets the
Location that this TileEntity resides
at. |
TileEntityType |
getType()
Gets the type of
TileEntity this is. |
boolean |
isValid()
Checks for whether the tile entity is currently valid or not.
|
void |
setValid(boolean valid)
Changes the validation of this tile entity.
|
setRawData, validateRawData
toContainer
getApplicableProperties, getProperty
boolean isValid()
Use this method to check if processing should be run on this
TileEntity
. If it is valid, then processing can be run on it.
If not, then processing should wait until it becomes valid or is
destroyed.
void setValid(boolean valid)
If the tile entity is invalid, no processing will be done on this
TileEntity
until it either becomes valid or is reset on the next
tick.
If the tile entity is valid, then processing can continue and this
TileEntity
will not be reset on the next tick.
valid
- True if the tile entity should be validated, or false if
it should be invalidatedTileEntityType getType()
TileEntity
this is.Location<World> getLocation()
Location
that this TileEntity
resides
at.
If the Location
's BlockType
is changed, this
TileEntity
may be removed as a consequence.
BlockState getBlock()
BlockState
that this TileEntity
represents.