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

PlayerLeashEntityEvent cancelled eats lead

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.20.4-R0.1-SNAPSHOT
    • Skyline
    • Yes

      When PlayerLeashEntityEvent is cancelled it eats the lead. (The lead disappears)

          @EventHandler
          public void onLeash(PlayerLeashEntityEvent event) {
              Player player = event.getPlayer();
              ItemStack itemStack = player.getInventory().getItemInMainHand();
              if(itemStack.hasItemMeta() && hookHandler.isHook(itemStack)) { //Todo: the item vanishes.
                  event.setCancelled(true);
              }
          } 

       

      Was bit unsure if spigot or buildtools was the correct place, but afterthought... 

            Unassigned Unassigned
            AlbusThePenguin Anonymous
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: