Closed ghost closed 7 years ago
NBTManager#write(Block, NBTCompound) method works only if block is TileEntity (it not works for usual blocks: stone, air, wood etc) you can write to the block only certain values, see wiki: http://minecraft.gamepedia.com/Chunk_format#Block_entity_format
"placedBy" is not described in wiki so you can not write it to the block. Also you can not change "x", "y" "z" tags of tile entities (this is the plugin restriction).
Hello, I'm trying to use the PowerNBT api. It is loaded as a plugin and added in maven as a dependency (which is correctly resolved). Maybe i'm misusing it ? Is NBTManager#write(Block, NBTCompound) not properly working ?
NBTManager manager = plugin.getNBTManager(); NBTCompound compound = manager.read(container); compound.put("placedBy", uniqueId.toString()); manager.write(container, compound); Bukkit.broadcastMessage("1: " + compound.getString("placedBy")); Bukkit.broadcastMessage("2: " + manager.read(container).getString("placedBy"));
Output : 1:
2: nothing