94 lines
1.8 KiB
Markdown
94 lines
1.8 KiB
Markdown
# IScriptTileEntity.setData
|
|
|
|
[← IScriptTileEntity](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 1/2 · [sonraki](setData-2.md)
|
|
|
|
setData(INBTCompound compound)
|
|
|
|
void Overwrite NBT data of this tile entity.
|
|
|
|
Method Detail
|
|
getMinecraftTileEntity
|
|
|
|
TileEntity getMinecraftTileEntity()
|
|
|
|
Get Minecraft tile entity instance. BEWARE: you need to know the MCP mappings in order to directly call methods on this
|
|
instance!
|
|
|
|
function main(c)
|
|
{
|
|
var itemInFirstSlot = c.getWorld().getTileEntity(-218, 101, 199).getMinecraftTileEntity().func_70301_a(0)
|
|
|
|
c.send(itemInFirstSlot)
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getId
|
|
|
|
java.lang.String getId()
|
|
|
|
Get tile entity's ID.
|
|
|
|
function main(c)
|
|
{
|
|
var BlockTileEntity = c.getWorld().getTileEntity(-218, 101, 199)
|
|
|
|
c.send(BlockTileEntity.getId())
|
|
}
|
|
|
|
|
|
isInvalid
|
|
|
|
boolean isInvalid()
|
|
|
|
Check whether this tile entity is invalid (i.e. was removed from the world or unavailable for some reason).
|
|
|
|
function main(c)
|
|
{
|
|
var BlockTileEntity = c.getWorld().getTileEntity(-218, 101, 199)
|
|
|
|
c.send(BlockTileEntity.isInvalid())
|
|
}
|
|
|
|
|
|
getData
|
|
|
|
INBTCompound getData()
|
|
|
|
Get (a copy of) this tile entity's NBT data.
|
|
|
|
function main(c)
|
|
{
|
|
var BlockTileEntity = c.getWorld().getTileEntity(-218, 101, 199)
|
|
|
|
c.send(BlockTileEntity.getData())
|
|
}
|
|
|
|
|
|
setData
|
|
|
|
void setData(INBTCompound compound)
|
|
|
|
Overwrite NBT data of this tile entity. WARNING: use it only if you know what are you doing as this method can corrupt tile
|
|
entities.
|
|
|
|
function main(c)
|
|
{
|
|
var BlockTileEntity = c.getWorld().getTileEntity(-218, 101, 199)
|
|
var tag = mappet.createCompound('{CookTime:0,x:-218,BurnTime:0,y:101,z:199,Item:[],id:"minecraft:furnace",CookTimeTotal:0,Lock:""}')
|
|
|
|
BlockTileEntity.setData(tag)
|
|
}
|
|
|
|
|
|
getTileData
|
|
|
|
INBTCompound getTileData()
|
|
|
|
Get Forge's custom tag compound in which you can story any data you want.
|
|
|