Package com.sk89q.worldedit.world
Interface NbtValued
- All Known Subinterfaces:
TileEntityBlock
- All Known Implementing Classes:
BaseBlock
,BaseEntity
,BaseItem
,BaseItemStack
,MobSpawnerBlock
,SignBlock
,SkullBlock
public interface NbtValued
Indicates an object that contains extra data identified as an NBT structure.
This interface is used when saving and loading objects to a serialized
format, but may be used in other cases.
-
Method Summary
Modifier and TypeMethodDescriptionGet the object's NBT data (tile entity data).boolean
Returns whether the block contains NBT data.void
setNbtData
(CompoundTag nbtData) Set the object's NBT data (tile entity data).
-
Method Details
-
hasNbtData
boolean hasNbtData()Returns whether the block contains NBT data.getNbtData()
must not return null if this method returns true.- Returns:
- true if there is NBT data
-
getNbtData
Get the object's NBT data (tile entity data). The returned tag, if modified in any way, should be sent tosetNbtData(CompoundTag)
so that the instance knows of the changes. Making changes without callingsetNbtData(CompoundTag)
could have unintended consequences.hasNbtData()
must return true if and only if method does not return null.- Returns:
- compound tag, or null
-
setNbtData
Set the object's NBT data (tile entity data).- Parameters:
nbtData
- NBT data, or null if no data
-