-
Bug
-
Resolution: Unresolved
-
None
-
1.19.3, 1.19.4 Pre-release 3, 1.21.1, 24w36a
-
None
-
Confirmed
-
Performance
-
Normal
-
Platform
The bug
An entity processing its motion on the X, Y and Z axis will check for collisions with blocks within a volume enclosed by the axis of motion. This is in spite of the fact that the entity can ONLY collide with blocks within each axis of motion which are processed independently every tick.
This culminated into a devastating effect when I fired a cannon 2000 blocks, which is only a fraction of it's maximum range, and then my game froze and the world was unrecoverable. It was fortunate I had saved a schematic of the cannon otherwise I would have lost the design completely.
OptimizedFastEntityMovement from Carpet Mod is an ideal solution because it makes it so entities ONLY process collisions from blocks directly in the path of each XYZ axis that the motion is processed along, preserving the current entity motion behaviour, while also vastly reducing the number of computations (this issue).
To reproduce
As an example here is a world download with the cannon positioned at 4K,4K in the overworld and setup to fire a payload at 0,0:
https://www.mediafire.com/file/vpf6ctq0cvfl0p7/Orbital_Strike_Crash_Test.zip/file
Instructions are as follows:
- Join the world and wait 1 minute
- Press the Button labelled "Start Cannon"
- The player will be teleported to 0,0,0 and the cannon will begin charging
- Note the TPS drop significantly due to large quantities of TnT performing inefficient calculations
- Note that eventually the game becomes unresponsive due to excessive collision checks as the cannon fires
- Note that the cannon works perfectly fine with optimizations running
You can also find the video about the cannon here: