Spigot NBT API 2.7.1

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

  1. tr7zw submitted a new resource:

    Item NBT API - Add custom NBT tags to Items without NMS!

    Read more about this resource...
     
  2. Maybe you can tell us some examples of what you can do with NBT data.
     
  3. The idea is from http://www.spigotmc.org/threads/custom-item-data-nbt-api.43987/ . You could add a lot of information to items like Owner history, where is was crafted/mined, custom enchantment data, kill/mine stats, rarity levels like in cs:go or what ever.
     
  4. Hey,

    Just thought I should mention that I added a function which might be useful to someone: https://github.com/ty2u/Item-NBT-API/blob/master/src/de/tr7zw/itemnbtapi/NBTReflectionutil.java#L17

    It helped me get spawn egg types which you can see how I used here: https://github.com/ty2u/spawner/blob/master/src/main/java/me/ryvix/spawner/SpawnerEvents.java#L395

    I also noticed a pull request from synquall ( https://github.com/tr7zw/Item-NBT-API/pull/1 ) which is the version I used in my plugin since it looked like it fixed some bugs.

    Thank you for the library!
     
  5. Does this has a maven repo? I want to use it in a Project, but i want dependencies to be managed by maven.
     
  6. Thanks for mentioning it. I'm using a private gitlab, so I didn't see the pull request on github.
     
    #8 tr7zw, Mar 11, 2016
    Last edited: Nov 2, 2018
  7. Maven repo added to the post!
    https://github.com/tr7zw/Item-NBT-API/blob/master/pom.xml
    But I never worked with maven, so I can't guarantee, that I break it^^
     
    #9 tr7zw, Mar 11, 2016
    Last edited: Nov 2, 2018
  8. I am having a problem with your setString() function. I want to increase the attack damage of a sword. In vanilla I would add this with a command:

    Code (Text):
    {AttributeModifiers:[{Slot:"mainhand",AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:20,Operation:0,UUIDLeast:1,UUIDMost:1}]}
    So with your plugin then:

    Code (Text):
    nbt.setString("AttributeModifiers", "[{Slot:\"mainhand\",AttributeName:\"generic.attackDamage\",Name:\"generic.attackDamage\",Amount:20,Operation:0,UUIDLeast:1,UUIDMost:1}]");
    Notice that all double quotes (") are escaped by a backslash (\) because it would otherwise have an error compiling. When I look in game however, I see this (with backslashes in the nbt data :eek:):

    [​IMG]

    Instead of the expected:
    [​IMG]
    (I made this last sword with a command)
     
  9. Can i add option to remove same tag nbt.removeNbt
    and to list all nbt key in item nbt.getKeys like String Array or some thing
     
  10. tr7zw updated Item NBT API with a new update entry:

    1.3 Update

    Read the rest of this update entry...
     
  11. A very useful tool. But I would like not only API but GUI for the plugin to change names of items and descriptions
     
  12. I will add this to the "What this API can't do"^^. This API accesses a NBTTagCompound in a ItemStack. This NBTTagCompound doesn't contain things like display name, lore, enchantments or the unbreaking tag.
     
  13. Could this be used to modify books with NBT data?
     
  14. If I have some time in the future, I will add support for Vanilla Tags. Currently this is not possible.
     
  15. tr7zw updated Item NBT API with a new update entry:

    Object support and NBTTagCompounds

    Read the rest of this update entry...
     
  16. Hi,
    I got two questons:
    1) As a developer, I can just add this .jar file to my project in the same way I add Spigot, correct? NOTE: Is the ordering important?
    2) You say:
    Code (Text):
    NBTItem nbti = new NBTItem(item);
    is this "item" a ItemStack?

    EDIT: I am a blockhead. Please ignore this :)