Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-272224

'in_bounding_box' vertical position for 'spawn_particles' effect is anchored incorrectly

XMLWordPrintable

    • Confirmed
    • Enchantments, Particles
    • Normal
    • Platform

      While working on a project of mine, I noticed that when I set the 'vertical_position' config in the 'spawn_particles' effect in the 'post_attack' component, particles weren't spawning in the upper half of attacked mob's bounding box. After a few tests, I discovered that the missing particles were spawning below the hit mob, and the maximum downwards distance from the entity's bounding box was equal to half the height of its hitbox. This likely suggests that the particles are anchored at the attacked mob's feet rather than the center of its bounding box.

      This does not happen with 'horizontal_position' or with any other effect component.

       

      EDIT: after further further testing in 1.21-pre1, I can confirm that this happens with EVERY effect component. I don't know if its always been the case and I can't test it

      Steps to reproduce

      Below I have attached a data pack with a singular enchantment that can be applied to a Diamond Sword with '/enchant @s bug:particle_post_damage'. Simply apply the enchantment to the sword and attack any mob. Notice that no particles are spawning in the upper part of its bounding box, and if done over see-through blocks (Glass, Barriers, etc.), some particles spawn underground, below hit entity.

       

      I have also attached a screenshot of the issue. Notice how a lot of particles spawn under the attacked Husk, but none spawn near its head (or generally in the upper part of its hitbox, as I have previously mentioned), but some spawn below the Iron Block floor. The Husk had had its scale attribute set to 3 for showcase purposes, but the issue also happens if the scale is set to 1 (default). I set my entity_interaction_range attribute to 100 so that I can attack it from a distance to make the particles as visible as possible

        1. 2024-05-19_20.29.00.png
          2024-05-19_20.29.00.png
          2.03 MB
        2. 2024-05-29_20.07.09.png
          2024-05-29_20.07.09.png
          1.88 MB
        3. bug.zip
          1 kB

            slicedlime [Mojang] slicedlime
            kohara kohara
            Votes:
            12 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: