[SPIGOT-7979] PlayerInteractEvent does not fire in Adventure mode for LEFT_CLICK_BLOCK actions Created: 12/Dec/24  Updated: 25/Dec/24  Resolved: 14/Dec/24

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

Type: Bug Priority: Minor
Reporter: Kevin Cranmer Assignee: md_5
Resolution: Fixed Votes: 0
Labels: API, bug, event, spigot
Environment:

Tested on Spigot 1.20.4-1.21.4 running a local server. Provided plugin is for 1.20.4


Attachments: File PlayerInteractEventBugPlugin-1.0-SNAPSHOT.jar    
Version: 4053-Spigot-e9ec548-98b6c1a (MC: 1.20.4)
Guidelines Read: Yes

 Description   

The 'PlayerInteractEvent' does not fire if all of the following is true:

  1. The player is in adventure mode
  2. The player left clicks
  3. The player has a block in front of them

I would expect the event to fire with an action value of LEFT_CLICK_BLOCK, which is the case if the player is in survival mode.

Other notes:

  • The event fires for LEFT_CLICK_AIR in adventure mode
  • Paper can fire the event for LEFT_CLICK_BLOCK in adventure mode

 

 

This may be intended behavior but it feels incorrect, so feel free to tell me "no".

 

 

 

Provided a sample plugin that sets your gamemode to adventure and listens for the PlayerInteractEvent so you can verify that punching a block in adventure mode does not trigger the PlayerInteractEvent. Switch back to survival mode and you can see that punching a block does not trigger the event.


Generated at Tue Apr 08 01:21:09 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.