[SPIGOT-7120] BlockPhysicsEvent not firing for rails at 1.19 Created: 27/Jul/22  Updated: 25/Dec/24

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

Type: Bug Priority: Minor
Reporter: Dymeth Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: 1.19, bug

Version: CraftBukkit version 3553-Spigot-14a2382-ef09464 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Expected behavior

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.

Observed/Actual behavior

It would be great to:
1) Fix BlockPhysicsEvent call
or
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:

@EventHandler
private void on(BlockPhysicsEvent event) {
    event.setCancelled(true);
}

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

Other

BlockPhysicsEvent call list when block under rails is destroyed:

1.18:

changed=GRASS_BLOCK;   block=GRASS_BLOCK;   source=AIR (175 84 1145)
changed=ACTIVATOR_RAIL;block=ACTIVATOR_RAIL;source=AIR (177 84 1145)
changed=DIRT;          block=DIRT;          source=AIR (176 83 1145)
changed=ACTIVATOR_RAIL;block=ACTIVATOR_RAIL;source=AIR (176 85 1145)
changed=AIR;           block=AIR;           source=AIR (176 84 1144)
changed=AIR;           block=AIR;           source=AIR (176 84 1146)
changed=AIR;           block=AIR;           source=AIR (176 84 1145)

1.19:

changed=AIR;           block=AIR;           source=AIR (-1371 70 2162)
changed=AIR;           block=AIR;           source=AIR (-1372 71 2162)
changed=AIR;           block=AIR;           source=AIR (-1372 70 2162)


 Comments   
Comment by Dymeth [ 28/Jul/22 ]

BlockDropItemEvent is not included in the test plugin. However, if i add it, it's called, but it doesn't allow to cancel the destruction of the rail block. So this does not solve my problem

Comment by Black Hole [ 27/Jul/22 ]

Please try if the BlockDropItemEvent is sufficient.

Generated at Sat Dec 13 19:00:24 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.