Package org.bukkit.block
Interface TileState
- All Superinterfaces:
BlockState
,Metadatable
,PersistentDataHolder
- All Known Subinterfaces:
Banner
,Barrel
,Beacon
,Bed
,Beehive
,Bell
,BlastFurnace
,BrewingStand
,BrushableBlock
,CalibratedSculkSensor
,Campfire
,Chest
,ChiseledBookshelf
,CommandBlock
,Comparator
,Conduit
,Container
,Crafter
,CreatureSpawner
,DaylightDetector
,DecoratedPot
,Dispenser
,Dropper
,EnchantingTable
,EnderChest
,EndGateway
,EntityBlockStorage<T>
,Furnace
,HangingSign
,Hopper
,Jigsaw
,Jukebox
,Lectern
,LockableTileState
,MovingPiston
,SculkCatalyst
,SculkSensor
,SculkShrieker
,ShulkerBox
,Sign
,Skull
,Smoker
,Structure
,SuspiciousSand
,TrialSpawner
Represents a block state that also hosts a tile entity at the given location.
This interface alone is merely a marker that does not provide any data.
Data about the tile entities is provided by the respective interface for each
tile entity type.
After modifying the data provided by a TileState,
BlockState.update()
needs to
be called to store the data.-
Method Summary
Modifier and TypeMethodDescriptionReturns a custom tag container capable of storing tags on the object.boolean
Checks if this TileState is a snapshot or a live representation of the underlying tile entity.Methods inherited from interface org.bukkit.block.BlockState
copy, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
Method Details
-
getPersistentDataContainer
Returns a custom tag container capable of storing tags on the object. Note that the tags stored on this container are all stored under their own custom namespace therefore modifying default tags using thisPersistentDataHolder
is impossible.This
PersistentDataHolder
is only linked to the snapshot instance stored by theBlockState
. When storing changes on thePersistentDataHolder
, the updated content will only be applied to the actual tile entity after one of theBlockState.update()
methods is called.- Specified by:
getPersistentDataContainer
in interfacePersistentDataHolder
- Returns:
- the custom tag container
-
isSnapshot
boolean isSnapshot()Checks if this TileState is a snapshot or a live representation of the underlying tile entity.NOTE: You may still have to call
BlockState.update()
on live representations to update any visuals on the block.- Returns:
- true if this is a snapshot
- See Also:
-