(Item/Entity/Tile) NBT API 1.6

Add custom NBT tags or modify tags of Items/Entities/Tiles without NMS!

  1. NBT Files

    tr7zw
    This update allows you to read/write nbt files. It can be used as an alternative to saveing data in yml format.
    Example:
    Code (Text):
     NBTFile file = new NBTFile(new File(getDataFolder(), "test.nbt"));
                file.addCompound("testcomp");
                file.setLong("time", System.currentTimeMillis());
                file.setString("test", "test");
                file.save();
    Secil likes this.
  2. 1.7 update

    tr7zw
    This update doesn't add new stuff, but adds support for 1.7 servers.
    Notes: Use a 1.7 with R4 (1.7.10), NBTLists may not work, everything using Gson is disabled(Add Gson before the NBTAPI loads, to turn it back on) and you can't get the NBTTypes, because 1.7 is missing this feature.
    RoboTricker likes this.
  3. TileEntity and Entity Update!

    tr7zw
    This huge update adds to NBTItem the following new supported classes: NBTEntity and NBTTileEntity! You are able to change all data they contain! Sadly it isn't possible to add custom tags to them.(They will just vanish!)

    Changes:
    • You can now access into the folder like structures of NBT Tags using the Compound methods
    • Using the toString() method on NBTItem/NBTEntity/NBTTileEntity returns a tree structure of all NBT tags
    • Added many new supported data types like Bytes,...
    RobinMC and MrDienns like this.
  4. Object support and NBTTagCompounds

    tr7zw
    It's now directly possible to save Objects into items via Gson (Thanks spaarkimus). Also, it's now possible to use NBTTagCompounds like folders. Technically this makes it even possible to access some more Vanilla tags. (A real implementation to have easy access to tags spigot is currently missing is planned :))
  5. 1.3.1 Update

    tr7zw
  6. 1.3 Update

    tr7zw
    Added:
    • removeKey(String key); returns void
    • getKeys(); returns Set<String>
    Tested in versions:
    • 1.7.10 (Why are you still using 1.7?!?)
    • 1.8.8
    • 1.9
    • 1.9.2
    • 1.9.4
    • 1.10
    • 1.10.2
    Notes:
    Using setString("key", null); acts like remove("key");
  7. Changes by synquall

    tr7zw
  8. Added "hasKey"

    tr7zw
    Simple "hasKey(String)" function.