Solved Add custom NBT tag to ItemStack?

Discussion in 'Spigot Plugin Development' started by Emilius123, Feb 16, 2020.

  1. Hello. I am currently running a Minecraft 1.14.3 Spigot Server. For the server, I am also developing a plugin just for fun. For the plugin, I'd like to have custom items. I would like to mark these custom items with a custom NBT tag, since that's the only way to ensure that it's really a custom item, not just a renamed one.

    I have found out, that the Spigot API has no way of doing that, and that I have to use nms. Since I have no experience using nms, I have no idea of how to set a custom NBT tag.
    I have found some resources on this, however none of them are using 1.14.3 (neither 1.14 in general).

    Could anybody please explain it to me, or link any good resources?
    Thanks in advance - Emilius123
     
    #1 Emilius123, Feb 16, 2020
    Last edited: Feb 16, 2020
  2. You're simply wrong. Just use the PersistentDataHolder API. ItemMeta implementing this interface.
     
    • Agree Agree x 2
  3. And there is a guide for it.
     
    • Agree Agree x 2