Expected Behavior
When an enchantment with a minecraft:apply_impulse entity effect imparts an impulse that would cause the player to collide with a wall, the impulse should be applied, causing the player to collide with the wall on the next tick.
Observed Behavior
When the impulse is applied through a minecraft:hit_block, minecraft:post_attack, or minecraft:post_piercing_attack trigger, the impulse is applied as expected.
When the impulse is applied through a minecraft:location_changed or a minecraft:tick trigger, if the x, y, or z component of the motion would cause the player to collide with a solid block within the next tick, that component of the motion is not applied to the player.
Steps to Reproduce
Add the attached datapack to a world, and reload the world completely to allow the custom enchantments to be registered.
For easier testing, create a hollow box to run tests inside, to prevent enchantments from dragging player into the distance.
Run the function
impulse_bug:give_enchanted_sticksto get 5 sticks, one with each of the custom enchantments.For each of the sticks, stand ~1.5 blocks back from the wall, rotate to be ~45 degrees from perpendicular to the wall, then:
For
hit_block, select the stick in the inventory, then left-click the wall.The player will have an impulse applied that carries them into the wall.
For
post_attack, place an armor stand between the player and the wall. Select the stick in the inventory then left-click the armor stand.The player will have an impulse applied that carries them into the wall.
For
post_piercing_attack, select the stick in the inventory, then left-click.The player will have an impulse applied that carries them into the wall.
For
location_changed, select the stick in the inventory. The enchantment should trigger immediately and repeatedly every time the player enters a new block.The player will have an impulse applied that carries them parallel to the wall.
For
tick, select the stick in the inventory. The enchantment should trigger immediately and repeatedly every tick.The player will have an impulse applied that carries them parallel to the wall.
Can confirm.