Since version 1.19, BlockPhysicsEvent is no longer called when the rail is destroyed. Thus, it is no longer possible to cancel the destruction of rails in the world when destroying the block below them.
It would be great to:
1) Fix BlockPhysicsEvent call
2) Create a separate event that can be canceled when a rail block is destroyed
The first solution is preferable because it is more universal and suitable for all other blocks, not just rails.
Steps/models to reproduce
1. Just create plugin with following code:
2. Run plugin with this plugin
3. Put rails on ground and break block under
4. Rails will be destroyed (and drop will be spawned)
Plugin and Datapack List
Plugins (2): Essentials, TestPlugin
There are 2 data packs enabled: [vanilla (built-in)], [file/bukkit (world)]
There are no more data packs available
BlockPhysicsEvent call list when block under rails is destroyed: