[UNSOLVED] Weapon/Tool/Item break event?

Discussion in 'Plugin Development' started by w00tklumpWn, Jan 25, 2012.

Thread Status:
Not open for further replies.
  1. Hi!

    Which event fires, when an item/weapon/tool in your hands break?
    And wth does the durability of an item rise, instead of just descend, and at zero it breaks?

    greets, Wutklumpen

    €dit: or can i get the maximum durability of an item somehow?

    Argh, no one?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
  2. Offline

    nisovin

    There is no event that fires, except PlayerInteractEvent. You could then check the durability. As far as I know, there is no way to get the max durability either, at least not through the Bukkit API.
     
    w00tklumpWn likes this.
  3. So i have to check for all Materials that have a durability, gather their values and ... ohar crap -.- Thats what i wanted to avoid. But thanks.
     
  4. Offline

    Bruno Lanevik

  5. Offline

    Likaos

    Necro... but I have the aswer for the next who will ask !
    Code:java
    1. @EventHandler(ignoreCancelled = true)
    2. public void onPlayerItemBreak(PlayerItemBreakEvent event) {
    3. event.getBrokenItem().setAmount(1);
    4. }
     
  6. Offline

    Garris0n

    The people who don't ask are also capable of simply doing a quick search/reading the javadocs, and the people who do ask won't search and won't find this.
     
Thread Status:
Not open for further replies.

Share This Page