[SPIGOT-1775] PlayerBucketEvent getBlockClicked() is off-by-one Created: 05/Mar/16  Updated: 06/Mar/16  Resolved: 06/Mar/16

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

Type: Bug Priority: Minor
Reporter: redwall_hp Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: 1.9


 Description   

When using PlayerBucketEmptyEvent's getBlockClicked() method, it appears to consistently return a value that's off-by-one. e.g. placing a block at x=0,y=64,z=-0 (thereby clicking x=0,y=63,z=-0) returns the block that was placed rather than the block clicked.

Basically, the equivalent of event.getBlockClicked().getRelative(event.getBlockFace()).

This behavior differs from the previous norm and doesn't match the described API. (Though the addition of a separate getBlock() method that does implement this behavior would be a desirable addition.)

Tested on the current latest version: git-Spigot-b39373b-73eff0d (MC: 1.9)

Code used:

@EventHandler
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
    getLogger().info("Clicked: " + event.getBlockClicked());
}

Generated at Fri Mar 21 18:35:23 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.