Trampling farmland calls BlockFadeEvent
Expected behavior
Trampling should not call the BlockFadeEvent
Observed/Actual behavior
It does call the BlockFadeEvent
Steps/models to reproduce
- listen for and cancel the block fade event
- trample a farmland block by jumping on it
- doesnt work
Plugin and Datapack List
irrelevant
Paper version
[15:42:27 INFO]: Checking version, please wait... [15:42:27 INFO]: This server is running Paper version 1.21.1-130-ver/1.21.1@4d2672e (2024-10-30T18:33:50Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) You are 1 version(s) behind Download the new version at: https://papermc.io/downloads/paper Previous version: 1.21.1-128-d348cb8 (MC: 1.21.1)
Other
The problem with this is that if you want to prevent natural block fading for farmland but allow trampling, you would have to implement a hacky solution which involves listening for the PlayerInteractEvent to track when a player tramples it
temporarily store that information for that specific block and let the BlockFadeEvent pass if the conditions are met
Do you know if this is a new issue, or has trampling farmland always called BlockFadeEvent?
I know for a fact that I encountered this issue back in 1.19, but didn't know it I looked at the code I ran back then, and it is basically the same as now
First time contributor here. I'd love to take a swing at this one.
It seems like this behaviour was changed in 2018 by spigot when they made the block fade event also be called for path blocks turning to dirt. Instead of adding an event call to the path block class, they instead moved the call to the turnToDirt method, (unintentionally?) making the event also be called for trampling
This definitely seems like it was unintentional