[SPIGOT-7501] PlayerInteractEvent only calling once while using a brush Created: 06/Oct/23  Updated: 25/Dec/24

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

Type: Bug Priority: Minor
Reporter: QarthO Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: bug

Version: This server is running CraftBukkit version 3904-Spigot-224dad5-1bf30a4 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Currently since there is no PlayerBrushEvent (which should be added), we're having to use the PlayerInteractEvent.

If a player begins to start "brushing" (holding right click with a brush in hand) the PlayerInteractEvent only fires one time, and not each time the player attempts to brush. This causes issues where we have no way to fully detect when a player is trying to brush a block.

Example:
If I'm attempting to create a land claiming plugin, and want to protect a player build. If the player is using suspicious gravel or sand in their build, there is no way to prevent another player from brushing. They can begin and start the "brushing" animation, while outside of the claim, (holding right click with a brush in hand), and continue this animation, walk into the claim then begin brushing the suspicious gravel/sand.

Here's a real example we're struggling with at GriefPrevention
https://github.com/TechFortress/GriefPrevention/pull/2162



 Comments   
Comment by Mihad Khondker [ 06/Oct/23 ]

Interesting situation, looking at NMS, it seems when a block is being brushed it becomes an entity. The entity seems to have these properties: required_brushes_to_break, brushCount. It also has these methods: boolean brush(player, direction), and getUpdatePacket() so you're correct an Event for this can be created and could exist. It seems the current API does not account for this Entity though so that would have to be the first step. I'll see if I can do anything, or if someone could take these observations and try as well.

Generated at Tue Apr 22 05:22:28 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.