Adding NMS Tags to ItemStacks using Reflection

Discussion in 'Plugin Development' started by OffsetPaladin89, Aug 28, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    OffsetPaladin89

    I was wondering how I would be able to add NMS Tags to items using Reflection. Normally, I know you would using something like this:
    Code:
    net.minecraft.server.v1_12_R1.ItemStack NMSitem = CraftItemStack.asNMSCopy(item);
    NBTTagCompound compound = NMSitem.getTag();
    compound.setString("Test", "Test");
    NMSitem.setTag(compound);
    item = CraftItemStack.asBukkitCopy(NMSitem);
    But I don't really understand how I'm supposed to convert this into Reflection. If anyone would be willing to explain how to convert it that would be great. Thank you in advance!
     
Thread Status:
Not open for further replies.

Share This Page