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

Particles produced from powder snow appear slightly too high


    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 21w03a, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w19a, 21w20a, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17, 1.17.1 Pre-release 1, 1.17.1, 1.18, 1.18.1, 1.18.2 Pre-release 1, 1.18.2, 1.19, 1.19.2, 1.19.3, 1.19.4, 1.20.1
    • Confirmed
    • Particles
    • Normal
    • Platform

      The Bug:

      Particles produced from powder snow appear slightly too high.

      Steps to Reproduce:

      1. Enable entity hitboxes by pressing "F3 + B".
      2. Sneak and walk along the edge of powder that is 2+ blocks high.
      3. Switch into third person so that you can see the particles being produced.
      4. Take note as to whether or not particles produced from powder snow appear slightly too high.

      Observed Behavior:

      Particles are produced slightly too high.

      Expected Behavior:

      Particles would not be produced slightly too high.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

      public class PowderSnowBlock extends Block implements BucketPickup {
         public void entityInside(BlockState $bs, Level $l, BlockPos $bp, Entity $e) {
            if (!($e instanceof LivingEntity) || $e.getFeetBlockState().is(this)) {
               $e.makeStuckInBlock($bs, new Vec3((double)0.9F, 1.5D, (double)0.9F));
               if ($l.isClientSide) {
                  Random random = $l.getRandom();
                  boolean flag = $e.xOld != $e.getX() || $e.zOld != $e.getZ();
                  if (flag && random.nextBoolean()) {
                     $l.addParticle(ParticleTypes.SNOWFLAKE, $e.getX(), (double)($bp.getY() + 1), $e.getZ(), (double)(Mth.randomBetween(random, -1.0F, 1.0F) * 0.083333336F), (double)0.05F, (double)(Mth.randomBetween(random, -1.0F, 1.0F) * 0.083333336F));

      If we look at the above class, we can see that the "y" level of where powder snow particles are produced is determined by one block above the powder snow block's position. This is evident through the following line of code:

      ($bp.getY() + 1)

      As a result of this, in some cases, the particles can appear too high.

            Unassigned Unassigned
            Avoma [Mod] Avoma
            11 Vote for this issue
            3 Start watching this issue