mojira.dev
MC-303493

The "minecraft:apply_impulse" entity effect does not apply components of the impulse that would cause the affected entity to hit a solid block when used with a "minecraft:tick" or "minecraft:location_changed" trigger

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

  1. Add the attached datapack to a world, and reload the world completely to allow the custom enchantments to be registered.

  2. For easier testing, create a hollow box to run tests inside, to prevent enchantments from dragging player into the distance.

  3. Run the function impulse_bug:give_enchanted_sticks to get 5 sticks, one with each of the custom enchantments.

  4. For each of the sticks, stand ~1.5 blocks back from the wall, rotate to be ~45 degrees from perpendicular to the wall, then:

    1. For hit_block, select the stick in the inventory, then left-click the wall.

      1. The player will have an impulse applied that carries them into the wall.

    2. 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.

      1. The player will have an impulse applied that carries them into the wall.

    3. For post_piercing_attack, select the stick in the inventory, then left-click.

      1. The player will have an impulse applied that carries them into the wall.

    4. For location_changed, select the stick in the inventory. The enchantment should trigger immediately and repeatedly every time the player enters a new block.

      1. The player will have an impulse applied that carries them parallel to the wall.

    5. For tick, select the stick in the inventory. The enchantment should trigger immediately and repeatedly every tick.

      1. The player will have an impulse applied that carries them parallel to the wall.

Attachments

Comments 1

DqwertyC

(Unassigned)

Confirmed

Platform

Normal

Collision, Data Packs, Enchantments

25w43a

Retrieved