Add enchantment glow to water bottle?

Discussion in 'Plugin Development' started by LordPyrak, Aug 28, 2014.

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

    LordPyrak

    Is there a way to add the enchantment glow to water bottles (for custom potions)?
    I've used this in a lot of my plugins, but it doesn't seem to work on water bottles:
    Code:java
    1. public static ItemStack addGlow(ItemStack item) {
    2. net.minecraft.server.v1_7_R3.ItemStack nmsStack = CraftItemStack
    3. .asNMSCopy(item);
    4. NBTTagCompound tag = null;
    5. if (!nmsStack.hasTag()) {
    6. tag = new NBTTagCompound();
    7. nmsStack.setTag(tag);
    8. }
    9. if (tag == null)
    10. tag = nmsStack.getTag();
    11. NBTTagList ench = new NBTTagList();
    12. tag.set("ench", ench);
    13. nmsStack.setTag(tag);
    14. return CraftItemStack.asCraftMirror(nmsStack);
    15. }

    I've also tried editing NBT data of actual custom potions (http://www.minecraftforum.net/forum.../381507-13w36b-1-7-custom-potions-format-give), but it just reverts to an awkward potion when I do.
     
  2. Can't you give the ItemStack (the bukkit class) a enchantment.
     
  3. Offline

    TheOddPuff

  4. Offline

    TheMintyMate

    This may apply.

    Hope this helped,
    - Minty
     
Thread Status:
Not open for further replies.

Share This Page