Solved Unbreakable Item in Bukkit?

Discussion in 'Plugin Development' started by Erwy, Sep 18, 2018.

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

    Erwy

    Sorry, everyone, I was trying to make a kit plugin which gives some items to players when they join/respawn.
    The problem is: how can I get an item (Iron sword / Fishing Rod) to be unbreakable?
    I have even tried to give it an Unbreakable X enchant and then hide it with addItemFlags(ItemFlag.Hide_Enchant) but that doesn't seem working. So I was wondering: is there a way to
    A) Give an item an Unbreakable enchant and then hide it
    or
    B) Set an item indestructible

    Thank you for your time!
     
  2. Offline

    Zombie_Striker

    @Erwy
    Use "setUnbreakable(true)" for the item's itemmeta to stop the item from being able to be damaged.
     
  3. Offline

    Erwy

Thread Status:
Not open for further replies.

Share This Page