public interface TileEntity extends DataHolder, Locatable
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 |
|---|---|
TileEntityArchetype |
createArchetype()
Creates a new
TileEntityArchetype for use with Schematics
and placing the archetype in multiple locations. |
BlockState |
getBlock()
Gets the
BlockState that this TileEntity represents. |
LocatableBlock |
getLocatableBlock()
Creates a
LocatableBlock for this TileEntity. |
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, validateRawDatagetContentVersion, toContainergetApplicableProperties, getPropertycopyFrom, copyFrom, get, getContainers, getOrCreate, offer, offer, offer, offer, offer, offer, remove, remove, remove, require, supports, transform, tryOffer, tryOffer, tryOffer, tryOffer, undocopy, get, getKeys, getOrElse, getOrNull, getValue, getValues, require, supports, supportsgetLocation, getWorldboolean 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.BlockState getBlock()
BlockState that this TileEntity represents.TileEntityArchetype createArchetype()
TileEntityArchetype for use with Schematics
and placing the archetype in multiple locations.LocatableBlock getLocatableBlock()
LocatableBlock for this TileEntity. Can be used
as a simpler method of making them. Since this does not persist the
data of this TileEntity, it should not be used in place of a
BlockSnapshot where data is being safely cloned.