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

Particles produced from dragon eggs teleporting cannot be seen by other players

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.18.1, 22w07a, 1.18.2 Pre-release 1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 23w18a, 1.20.1, 1.21
    • Confirmed
    • Networking
    • Normal
    • Platform

      The Bug:

      Particles produced from dragon eggs teleporting cannot be seen by other players.

      Steps to Reproduce:

      1. Obtain a dragon egg and place it down.
      2. Get two players and label them "Player A" and "Player B".
      3. Have "Player A" stand a fair distance away from the dragon egg whilst looking in its direction.
      4. Have "Player B" teleport the dragon egg by right-clicking on it.
      5. Get both players to watch closely at the particles produced as the dragon egg teleports.
      6. Take note as to whether or not particles produced from dragon eggs teleporting can be seen by other players.

      Observed Behavior:

      Dragon egg teleportation particles can only be seen by the person who interacted with the dragon egg, and not other players.

      Expected Behavior:

      Dragon egg teleportation particles would be seen by all players.

      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.

      net.minecraft.world.level.block.DragonEggBlock.java
      public class DragonEggBlock extends FallingBlock {
         ...
         private void teleport(BlockState $bs, Level $l, BlockPos $bp) {
            ...
            for(int i = 0; i < 1000; ++i) {
               BlockPos blockpos = $bp.offset($l.random.nextInt(16) - $l.random.nextInt(16), $l.random.nextInt(8) - $l.random.nextInt(8), $l.random.nextInt(16) - $l.random.nextInt(16));
               ...
                  if ($l.isClientSide) {
                     for(int j = 0; j < 128; ++j) {
                        double d0 = $l.random.nextDouble();
                        float f = ($l.random.nextFloat() - 0.5F) * 0.2F;
                        float f1 = ($l.random.nextFloat() - 0.5F) * 0.2F;
                        float f2 = ($l.random.nextFloat() - 0.5F) * 0.2F;
                        double d1 = Mth.lerp(d0, (double)blockpos.getX(), (double)$bp.getX()) + ($l.random.nextDouble() - 0.5D) + 0.5D;
                        double d2 = Mth.lerp(d0, (double)blockpos.getY(), (double)$bp.getY()) + $l.random.nextDouble() - 0.5D;
                        double d3 = Mth.lerp(d0, (double)blockpos.getZ(), (double)$bp.getZ()) + ($l.random.nextDouble() - 0.5D) + 0.5D;
                        $l.addParticle(ParticleTypes.PORTAL, d1, d2, d3, (double)f, (double)f1, (double)f2);
                     }
                  ...

      If we look at the above class, we can see that particles produced from dragon eggs teleporting are only produced client-side. This is evident through the following line of code:

      if ($l.isClientSide)

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            6 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: