Interface BlockEntity
- 
- All Superinterfaces:
- CopyableDataHolder,- DataHolder,- DataHolder.Mutable,- DataSerializable,- Locatable,- SerializableDataHolder,- SerializableDataHolder.Mutable,- ValueContainer
 - All Known Subinterfaces:
- Banner,- Barrel,- Beacon,- Bed,- Beehive,- Bell,- BlastFurnace,- BrewingStand,- Campfire,- CarrierBlockEntity,- Chest,- CommandBlock,- Comparator,- Conduit,- DaylightDetector,- Dispenser,- Dropper,- EnchantmentTable,- EnderChest,- EndGateway,- EndPortal,- Furnace,- FurnaceBlockEntity,- Hopper,- Jigsaw,- Jukebox,- Lectern,- MobSpawner,- NameableBlockEntity,- NameableCarrierBlockEntity,- Piston,- ShulkerBox,- Sign,- Skull,- Smoker,- StructureBlock,- TrappedChest
 
 @DoNotStore public interface BlockEntity extends SerializableDataHolder.Mutable, Locatable Represents a block entity. It is a functional block that is continuously updated while residing in a world. It can perform specific functions based on the data that it contains.A BlockEntityis contained within aServerLocationand will continue to exists so long as theServerLocationis of the correct block type.Since a BlockEntityis performing various actions, all methods that are purely functional methods reside in theBlockEntity, whereas customizable data associated with aBlockEntityis represented byValues.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolderDataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolderSerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BlockStateblock()Gets theBlockStatethat thisBlockEntityrepresents.BlockEntitycopy()Creates a newBlockEntityArchetypefor use withSchematics and placing the archetype in multiple locations.BlockEntityArchetypecreateArchetype()Creates a newBlockEntityArchetypefor use withSchematics and placing the archetype in multiple locations.booleanisValid()Checks for whether the block entity is currently valid or not.LocatableBlocklocatableBlock()Creates aLocatableBlockfor thisBlockEntity.default BlockEntitymirror(java.util.function.Supplier<? extends Mirror> mirror)Gets the appropriateBlockEntityfor the desiredMirror.BlockEntitymirror(Mirror mirror)Gets the appropriateBlockEntityfor the desiredMirror.default BlockEntityrotate(java.util.function.Supplier<? extends Rotation> rotation)Rotates thisBlockEntityfor the desiredRotation.BlockEntityrotate(Rotation rotation)Rotates thisBlockEntityfor the desiredRotation.voidsetValid(boolean valid)Changes the validation of this block entity.BlockEntityTypetype()Gets the type ofBlockEntitythis is.- 
Methods inherited from interface org.spongepowered.api.data.DataHolder.MutablecopyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
 - 
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializablecontentVersion, toContainer
 - 
Methods inherited from interface org.spongepowered.api.world.LocatableblockPosition, location, serverLocation, world
 - 
Methods inherited from interface org.spongepowered.api.data.SerializableDataHoldervalidateRawData
 - 
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder.MutablesetRawData
 
- 
 
- 
- 
- 
Method Detail- 
isValidboolean isValid() Checks for whether the block entity is currently valid or not.Use this method to check if processing should be run on this BlockEntity. If it is valid, then processing can be run on it. If not, then processing should wait until it becomes valid or is destroyed.- Returns:
- True if the block entity is valid, false if not
 
 - 
setValidvoid setValid(boolean valid) Changes the validation of this block entity.If the block entity is invalid, no processing will be done on this BlockEntityuntil it either becomes valid or is reset on the next tick.If the block entity is valid, then processing can continue and this BlockEntitywill not be reset on the next tick.- Parameters:
- valid- True if the block entity should be validated, or false if it should be invalidated
 
 - 
typeBlockEntityType type() Gets the type ofBlockEntitythis is.- Returns:
- The type of block entity
 
 - 
blockBlockState block() Gets theBlockStatethat thisBlockEntityrepresents.- Returns:
- The blockstate
 
 - 
rotateBlockEntity rotate(Rotation rotation) Rotates thisBlockEntityfor the desiredRotation.- Parameters:
- rotation- The rotation
- Returns:
- The rotated state if not this state
 
 - 
rotatedefault BlockEntity rotate(java.util.function.Supplier<? extends Rotation> rotation) Rotates thisBlockEntityfor the desiredRotation.- Parameters:
- rotation- The rotation
- Returns:
- The rotated state if not this state
 
 - 
mirrorBlockEntity mirror(Mirror mirror) Gets the appropriateBlockEntityfor the desiredMirror.- Parameters:
- mirror- The mirror
- Returns:
- The mirrored BlockEntity
 
 - 
mirrordefault BlockEntity mirror(java.util.function.Supplier<? extends Mirror> mirror) Gets the appropriateBlockEntityfor the desiredMirror.- Parameters:
- mirror- The mirror
- Returns:
- The mirrored BlockEntity
 
 - 
createArchetypeBlockEntityArchetype createArchetype() Creates a newBlockEntityArchetypefor use withSchematics and placing the archetype in multiple locations.- Returns:
- The created archetype for re-creating this block entity
 
 - 
locatableBlockLocatableBlock locatableBlock() Creates aLocatableBlockfor thisBlockEntity. Can be used as a simpler method of making them. Since this does not persist the data of thisBlockEntity, it should not be used in place of aBlockSnapshotwhere data is being safely cloned.- Returns:
- The created locatable block, not as a block snapshot
 
 - 
copyBlockEntity copy() Creates a newBlockEntityArchetypefor use withSchematics and placing the archetype in multiple locations.- Specified by:
- copyin interface- CopyableDataHolder
- Specified by:
- copyin interface- SerializableDataHolder
- Specified by:
- copyin interface- SerializableDataHolder.Mutable
- Returns:
- The created archetype for re-creating this block entity
 
 
- 
 
-