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

PlayerBucketEmptyEvent's setItemStack() method has no effect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None

      If you listen to a bucket event and try to set the resulting item stack in the player's hand, there is no effect. It will update the ItemStack at the API level, meaning you can retrieve the new ItemStack with getItemStack(), but the actual in-game item will not be changed. They will always receive an empty bucket.

      The resulting event handler illustrates this behavior on the latest Spigot version:

      @EventHandler
      public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
          event.setItemStack(new ItemStack(Material.DIRT, 1));  
      }
      

            Unassigned Unassigned
            redwall_hp redwall_hp
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: