Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6708

setRepairAmount of the PlayerItemMendEvent is broken ?

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • 3216-Spigot-ff89b97-61e4ca7 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT)
    • Yes

    Description

      I tried to modify the repair amount of mending using the setRepairAmount method.
      But as soon i use this method e.g. setRepairAmount(1) the PlayerItemMendEvent will be called more then 500 times (which results that the item is instantly repaired).

      Output: https://paste.md-5.net/ajirexulic.md

      In Class A:

      @EventHandler
          public void mending(PlayerItemMendEvent event) {
              System.out.println("MENDING EVENT CALLED");
          }

      In Class B:

      @EventHandler
          public void mending(PlayerItemMendEvent event) {
              event.setRepairAmount(1);
          }
      

      (Two event listeners to be sure if the event will be called multiple times or if the debug message will be outputed multiple times)

      Attachments

        Activity

          People

            Unassigned Unassigned
            False False
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: