[SPIGOT-2560] PlayerBucketEmptyEvent's setItemStack() method has no effect Created: 30/Jul/16  Updated: 17/Oct/20

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: redwall_hp Assignee: Unassigned
Resolution: Unresolved Votes: 5
Labels: bukkit


 Description   

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));  
}


 Comments   
Comment by gecko10000 [ 17/Oct/20 ]

Still broken.

Comment by Jake Ben-Tovim [ 21/May/20 ]

I'd like to bump this as well. Trying to make an infinite bucket, and the natural thought process would be to call setItemStack with a clone of the item in hand in the event, and it simply does nothing. It's straight up broken API, perhaps the prio should be slightly higher.

Comment by kukelekuuk [ 21/Oct/19 ]

Any word on this? It has been 3 years.

Generated at Wed Apr 02 10:57:30 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.