(Item/Entity/Tile) NBT API 1.7-BETA

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

  1. Internal rewrite, 1.13 update

    This Beta release (it's still work in progress, but works) is a rewrite of the internal workings of the NBT-API. So far the rewrite has added-up to removing 400 lines while keeping all functions and making the code better maintainable. I was able to add 1.13 support into this build in about 30 minutes of work, so the cleared code paid out.
    • All (finished migrating) reflections get checked at plugin start, so all "Class not found" and "Method not found" will show up at...
    LogoCat likes this.
  2. NBT Files

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

    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.
  4. TileEntity and Entity Update!

    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!)

    • 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.
  5. Object support and NBTTagCompounds

    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 :))
  6. 1.3.1 Update

  7. 1.3 Update

    • 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
    Using setString("key", null); acts like remove("key");
  8. Changes by synquall

  9. Added "hasKey"

    Simple "hasKey(String)" function.