Repairing broken items

Discussion in 'Plugin Development' started by CakePvP, Mar 31, 2013.

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


    I've been wondering how to fix this for a couple days.

    I've already tried to clone the item and add it back the inventory and I've also tried setting the durability to 0, which in theory would cancel the event.

    Current code:
        public void onBreak(PlayerItemBreakEvent e) {
            Player player = e.getPlayer();
            ItemStack itemStack = e.getBrokenItem().clone();
  , "Repaired your §c§l" + e.getBrokenItem().getType().name());
  2. Offline


    You could try setting the durability higher when it reaches a certain level(?)
Thread Status:
Not open for further replies.

Share This Page