[MC-2157] Particles emitted from dragon egg when teleporting are not pointing in the correct direction Created: 03/Nov/12  Updated: 11/Dec/24

Status: Reopened
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.7, Snapshot 13w05b, Minecraft 1.5, Minecraft 1.7.4, Minecraft 14w03b, Minecraft 14w34d, Minecraft 1.8, Minecraft 1.8.1-pre2, Minecraft 1.8.1-pre5, Minecraft 15w31c, Minecraft 15w49b, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w17b, Minecraft 1.12 Pre-Release 6, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w06a, Minecraft 18w08b, Minecraft 18w11a, Minecraft 18w16a, Minecraft 18w21a, Minecraft 1.13-pre1, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04a, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, Minecraft 19w12a, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.1 Pre-Release 2, Minecraft 1.14.1, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 1, Minecraft 1.14.3 Pre-Release 2, Minecraft 1.14.3 Pre-Release 3, Minecraft 1.14.3 Pre-Release 4, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 2, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 4, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4 Pre-Release 7, 1.14.4, 19w34a, 19w35a, 19w37a, 19w38b, 19w38a, 19w39a, 19w40a, 19w41a, 19w42a, 19w44a, 19w45a, 19w45b, 19w46a, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 5, 1.15 Pre-release 7, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Pre-release 2, 1.17 Release Candidate 2, 1.17, 1.17.1 Release Candidate 1, 1.17.1, 21w37a, 21w39a, 21w40a, 21w42a, 21w44a, 1.18 Pre-release 4, 1.18 Release Candidate 3, 1.18, 1.18.1 Release Candidate 1, 1.18.1, 22w07a, 1.18.2, 22w12a, 1.19 Pre-release 1, 1.19, 22w24a, 1.19.1, 1.19.2, 22w43a, 1.19.3, 23w05a, 23w06a, 1.19.4 Pre-release 3, 1.19.4, 23w14a, 23w17a, 1.20 Release Candidate 1, 1.20, 1.20.1, 23w31a, 1.20.2, 23w40a, 23w43a, 1.20.3 Pre-Release 2, 1.20.4, 24w12a, 24w21b, 1.21 Release Candidate 1, 1.21, 24w33a, 1.21.1, 24w44a, 1.21.4 Pre-Release 1, 1.21.4
Fix Version/s: None

Type: Bug
Reporter: [Mod] Sonicwave Assignee: Unassigned
Resolution: Unresolved Votes: 89
Labels: 12w18a, dragon_egg

Attachments: PNG File 2021-05-13_10.09.24.png     File MC-2157 How it used to work in 1.2.5.mp4     File MC-2157.mp4     JPEG File screenshot-1.jpg    
Issue Links:
Duplicate
is duplicated by MC-44656 ender egg particles not pointing wher... Resolved
is duplicated by MC-84535 Dragon Egg particles don't go in the ... Resolved
is duplicated by MC-132232 dragon egg teleports not in the same ... Resolved
is duplicated by MC-166964 Dragon egg disappears Resolved
is duplicated by MC-168966 the dragon egg particals do not line ... Resolved
Relates
relates to MC-114217 Lightning strikes are randomized serv... Open
relates to MC-258347 Enderman's teleport no longer creates... Open
relates to MC-160 Dragon egg particles are missing Resolved
relates to MC-248666 Particles produced from dragon eggs t... Open
relates to MC-84517 Chorus fruit particles not showing in... Resolved
relates to MC-260379 Teleport with chorus fruit does not c... Resolved
relates to MC-2663 Enderman particles bug orientation Resolved
CHK:
Confirmation Status: Confirmed
Category:
Particles
Mojang Priority: Low
Area: Gameplay

 Description   

The Bug

When you cause a dragon egg to teleport (such as by clicking on it), the teleportation particles point in a random direction and not to the actual location of the dragon egg.

Steps to Reproduce

  • Give yourself a dragon egg and place it down.
    /give @s minecraft:dragon_egg
    
  • Interact with the dragon egg, (right-click by default) to make it teleport.
  • Take note of the particles produced upon doing this and what direction they're pointing in.
  • Locate where the dragon egg is and check whether the particles pointed in the correct direction.

Observed Behavior

Particles produced from a dragon egg upon interacting with it don't point in the direction of where the egg was teleported to.

Expected Behavior

Particles produced from a dragon egg upon interacting with it would point in the direction of where the egg was teleported to.

Code Analysis

Code analysis by marcono1234 can be found in this comment, and code analysis by ISRosillo14 can be found in this comment.



 Comments   
Comment by Ismael Rosillo [ 24/Nov/23 ]

Can confirm in 1.20.2 and 1.20.3 Pre-release 2. Regarding the proposed fix by ~marcono1234, there's a problem which makes it unviable, as it creates way too many single particles, and each one is sent by the server to every player (client) near the egg, which definitely would lag the server.

So the rest of this comment will adress an alternate fix, which has been already tested on my modified client and seems to work fine without creating lag. Here it is:

The concept of this fix is to basically let server tell the client that it has to create various teleport particles from one position to another. For this we are going to take advantage of the LevelEvent feature, which consists of sending packet ClientBoundLevelEventPacket from server to client (so now we are reducing from hundreds of packets to a single one), but since not everything is perfect, I had to modify level event's integer "data" parameter to use a long number, since we want to store the destination position on the packet witout altering this feature's behaviour (this is why I'm not suggesting to add another BlockPos parameter to the packet, because otherwise it would break this feature for any other part of the game using it and would add more weight), so now we can use the got destination position's BlockPos.asLong() directly at BlockDragonEgg.teleport(BlockState, Level, BlockPos) and through "LevelEvent" the client will handle the teleport particles correctly at LevelRenderer.levelEvent(int, BlockPos, int).

Code attachment depicting the classes I changed (excluding all LevelEvent methods' changes to "data" parameter, from integer numbers to long ones). From decompiled minecraft 1.19.3 by MCP Reborn using official mapping and my own parameter names.

package net.minecraft.world.level.block;

public class DragonEggBlock extends FallingBlock {
   //...

   private void teleport(BlockState thisState, Level level, BlockPos position) {
       if (level.isClientSide) {//no need to use this method in the client anymore, make it server-side only
           return;
       }

       WorldBorder worldborder = level.getWorldBorder();

       for (int tries = 0; tries < 1000; ++tries) {
           BlockPos destPos = position.offset(level.random.nextInt(16) - level.random.nextInt(16), level.random.nextInt(8) - level.random.nextInt(8), level.random.nextInt(16) - level.random.nextInt(16));

           if (level.getBlockState(destPos).isAir() && worldborder.isWithinBounds(destPos)) {
               level.setBlock(destPos, thisState, 2);
               level.removeBlock(position, false);
               level.levelEvent(1999, destPos, position.asLong());//send DRAGON_EGG_TELEPORT LevelEvent
               return;
           }
       }
   }

   //...
} 

Also, in these examples I assigned "1999" as the id of this level event type I added (also present in net.minecraft.level.block.LevelEvent.DRAGON_EGG_TELEPORT).

package net.minecraft.client.renderer;

public class LevelRenderer implements ResourceManagerReloadListener, AutoCloseable {
   //...
   public void levelEvent(int p_234305_, BlockPos eventPos, long /* instead of int */ data) {
      RandomSource randomsource = this.level.random;
      int dataAsInt = (int)data; //compatibilize with other level events
      switch (p_234305_) {
         //...
         case 1999: /* using this number for DRAGON_EGG_TELEPORT event */
             BlockPos destPos = BlockPos.of(data);//this is why we need long number

             for (int j = 0; j < 128; ++j) {//this is moved from DragonEggBlock.teleport(..)
                 double d0 = randomsource.nextDouble();
                 float f0 = (randomsource.nextFloat() - 0.5F) * 0.2F;
                 float f1 = (randomsource.nextFloat() - 0.5F) * 0.2F;
                 float f2 = (randomsource.nextFloat() - 0.5F) * 0.2F;
                 double d1 = Mth.lerp(d0, (double)destPos.getX(), (double)eventPos.getX()) + (randomsource.nextDouble() - 0.5D) + 0.5D;
                 double d2 = Mth.lerp(d0, (double)destPos.getY(), (double)eventPos.getY()) + randomsource.nextDouble() - 0.5D;
                 double d3 = Mth.lerp(d0, (double)destPos.getZ(), (double)eventPos.getZ()) + (randomsource.nextDouble() - 0.5D) + 0.5D;
                 this.level.addParticle(ParticleTypes.PORTAL, d1, d2, d3, (double)f0, (double)f1, (double)f2);
             }

             break;
          //...
      }
   }

   //...
} 

In short, instead of creating the particles by the server like Marcono said, we are making the client create them to reduce packet usage, while also fixing this bug.

Comment by Brain81505 [ 11/Feb/23 ]

Can confirm in 23w06a

Comment by Brain81505 [ 01/Feb/23 ]

Can confirm in 23w05a

Comment by [Mod] Avoma [ 06/Aug/22 ]

Can confirm in 1.19.2.

Comment by [Mod] Avoma [ 28/Jul/22 ]

Can confirm in 1.19.1.

Comment by [Mod] Avoma [ 08/Jun/22 ]

Can confirm in 1.19.

Comment by RXB3000 [ 21/May/22 ]

Can confirm in 1.19 prerelease-1

Comment by [Mod] Avoma [ 02/Mar/22 ]

Can confirm in 1.18.2.

Comment by [Mod] Avoma [ 14/Dec/21 ]

Can confirm in 1.18.1.

Comment by [Helper] clam lol [ 18/Nov/21 ]

Affects 1.18-pre4.

Comment by [Mod] ampolive [ 10/Nov/21 ]

Can confirm in 21w44a.

Comment by [Mod] ampolive [ 20/Oct/21 ]

Can confirm in 21w42a.

Comment by [Mod] ampolive [ 12/Oct/21 ]

Can confirm in 21w40a.

Comment by [Mod] Avoma [ 04/Oct/21 ]

I am able to confirm this behavior in 21w39a. Here are some extra details regarding this issue.

The Bug:

Particles produced from a dragon egg upon interacting with it don't point in the direction of where the egg was teleported to.

Steps to Reproduce:

  • Give yourself a dragon egg and place it down.
  • /give @s minecraft:dragon_egg
  • Interact with the dragon egg, (right-click by default) to make it teleport.
  • Take note of the particles produced upon doing this and what direction they're pointing in.
  • Locate where the dragon egg is and check whether the particles pointed in the correct direction.

Observed Behavior:

Particles produced from a dragon egg upon interacting with it don't point in the direction of where the egg was teleported to.

Expected Behavior:

Particles produced from a dragon egg upon interacting with it would point in the direction of where the egg was teleported to.

Comment by [Mod] ampolive [ 18/Sep/21 ]

Can confirm in 21w37a.

Comment by [Mod] ampolive [ 03/Jul/21 ]

Can confirm in 1.17.1 Release Candidate 1.

Comment by bugsbugsbugs [ 25/Mar/21 ]

Attached a vidoe showing how it used to work in 1.2.5, MC-2157 How it used to work in 1.2.5.mp4

Comment by [Mod] Avoma [ 04/Feb/21 ]

Can confirm in 21w05b.

Comment by [Mod] Avoma [ 03/Feb/21 ]

Can confirm in 21w05a.

Comment by [Mod] Avoma [ 25/Nov/20 ]

Can confirm in 20w48a.

Comment by Conem [ 17/Jun/20 ]

Confirmed in 1.16-pre7.

Comment by Conem [ 16/Jun/20 ]

Confirmed in 1.16-pre6.

Comment by Conem [ 12/Jun/20 ]

Confirmed in 1.16-pre5.

Comment by Conem [ 10/Jun/20 ]

Confirmed in 1.16-pre3.

Comment by TheBoy358 [ 08/Nov/19 ]

Confirmed in 19w45b.

Comment by [Helper] Jack McKalling [ 13/May/19 ]

Confirmed for 1.14.1

Comment by [Helper] Jack McKalling [ 09/May/19 ]

Confirmed for 1.14.1 pre-2

Comment by [Helper] Jack McKalling [ 07/May/19 ]

Confirmed for 1.14.1 pre-1

Comment by [Helper] Jack McKalling [ 23/Apr/19 ]

Confirmed for 1.14

Comment by [Helper] Jack McKalling [ 18/Apr/19 ]

Confirmed for 1.14 pre-5

Comment by [Helper] Jack McKalling [ 17/Apr/19 ]

Confirmed for 1.14 pre-4

Comment by [Helper] Jack McKalling [ 16/Apr/19 ]

Confirmed for 1.14 pre-3

Comment by [Helper] Jack McKalling [ 15/Apr/19 ]

Confirmed for 1.14 pre-2

Comment by [Helper] Jack McKalling [ 10/Apr/19 ]

Confirmed for 1.14 pre-1

Comment by [Helper] Jack McKalling [ 08/Apr/19 ]

Confirmed for 19w14b

Comment by [Helper] Jack McKalling [ 03/Apr/19 ]

Confirmed for 19w14a

Comment by [Helper] Jack McKalling [ 29/Mar/19 ]

Confirmed for 19w13b

Comment by [Helper] Jack McKalling [ 27/Mar/19 ]

Confirmed for 19w13a

Comment by [Helper] Jack McKalling [ 21/Mar/19 ]

Confirmed for 19w12b

Comment by [Helper] Jack McKalling [ 20/Mar/19 ]

Confirmed for 19w12a

Comment by [Helper] Jack McKalling [ 14/Mar/19 ]

Confirmed for 19w11b

Comment by [Helper] Jack McKalling [ 13/Mar/19 ]

Confirmed for 19w11a

Comment by [Helper] Jack McKalling [ 28/Feb/19 ]

Confirmed for 19w09a

Comment by [Helper] Jack McKalling [ 13/Feb/19 ]

Confirmed for 19w07a

Comment by [Helper] Jack McKalling [ 06/Feb/19 ]

Confirmed for 19w06a

Comment by [Helper] Jack McKalling [ 30/Jan/19 ]

Confirmed for 19w04b and 19w05a

Comment by [Helper] Jack McKalling [ 24/Jan/19 ]

Comfirmed for 19w04a

Comment by [Helper] Jack McKalling [ 19/Jan/19 ]

Confirmed for 19w03c

Comment by [Helper] Jack McKalling [ 17/Jan/19 ]

Confirmed for 19w03b

Comment by [Helper] Jack McKalling [ 16/Jan/19 ]

Confirmed for 19w03a

Comment by [Helper] Jack McKalling [ 09/Jan/19 ]

Confirmed for 19w02a

Comment by [Helper] Jack McKalling [ 12/Dec/18 ]

Confirmed for 18w50a

Comment by [Helper] Jack McKalling [ 05/Dec/18 ]

Confirmed for 18w49a

Comment by Kraif [ 24/Aug/18 ]

Confirmed for 1.13.1.

Comment by Paul Rozhkov [ 17/Jul/18 ]

can reproduce in 1.13-pre10

Comment by Paul Rozhkov [ 14/Jul/18 ]

can reproduce in 1.13-pre8

Comment by Paul Rozhkov [ 10/Jul/18 ]

can reproduce in 1.13-pre7

Comment by Paul Rozhkov [ 04/Jul/18 ]

can reproduce in 1.13-pre6

Comment by Matthew [ 28/Jun/18 ]

Can confirm in 1.13-pre5.

Please keep the affected versions up-to-date. 

Comment by Fabian Röling [ 26/Oct/17 ]

After receiving six mails because of this, I want to make it clear: Hazmi35, please check the affected version list at the top of the report before submitting such a comment, you're sending multiple mails with each of those comments, in total about 100 mails were just caused by you and FVBico. Even though it might look like it, the comments are not the place to keep track of the versions.

Comment by user-f2760 (Inactive) [ 26/Oct/17 ]

Is already marked as affected.

Comment by hzmi [ 26/Oct/17 ]

Confirmed for 1.12.2

Comment by [Mod] Michael Wobst [ 14/Jun/17 ]

Ticket is yours now, ericz1

Comment by [Mod] Sonicwave [ 14/Jun/17 ]

Confirmed for 1.12.

Comment by user33 [ 31/May/17 ]

Confirmed for 1.12-pre6

Comment by user33 [ 01/May/17 ]

Confirmed for 17w17b

Comment by Ben Mintz [ 18/Aug/16 ]

Yes I know. If I had seen your comment earlier I wouldn't have also said confirmed for "16w32b".

Comment by user-f2760 (Inactive) [ 17/Aug/16 ]

Affects Version/s: ......Minecraft 1.10.2, Minecraft 16w32b

Also marked as affected...

Comment by Ben Mintz [ 17/Aug/16 ]

Confirmed for 16w32b

EDIT: oh lol i didn't see your comment until after i said confirmed for 16w32b

I wonder if there are plans to fix this for 1.11?

Comment by user-f2760 (Inactive) [ 17/Aug/16 ]

Is already marked as affected...

Comment by Ben Mintz [ 17/Aug/16 ]

Confirmed for 1.10.2

Comment by Marcono1234 [ 12/Mar/16 ]

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is probably the fix of MC-160. That bug probably occurred due to the problem described in MC-10369. I assume at this point the method creating the particles was changed to create the particles client side only. The problem is that the net.minecraft.block.BlockDragonEgg.teleport(World, BlockPos) method which is responsible for this is called by client and server. The client uses it for creating the particles, the server for setting the dragon egg. Both call the method java.util.Random.nextInt(int) which returns different coordinates for the client and the server.
This could be solved by having the server creating the particles.

Comment by Marcono1234 [ 12/Mar/16 ]

Confirmed for

  • 1.9.1-pre3
Comment by Esophose [ 03/Dec/15 ]

Confirmed for 15w49b

Comment by [Mod] Sonicwave [ 01/Aug/15 ]

MC-84535 confirms for 15w31c.

Comment by [Mod] Sonicwave [ 21/Nov/14 ]

Confirmed for 1.8.1-pre5.

Comment by [Mod] Sonicwave [ 21/Oct/14 ]

Confirmed for 1.8.1-pre2.

Comment by [Mod] Sonicwave [ 03/Oct/14 ]

Confirmed in 1.8.

Comment by Galaxy_2Alex [ 21/Aug/14 ]

Confirmed for 14w32d

Comment by Fluffy89502 [ 26/Jan/14 ]

Confirmed in 1.7.4

Comment by [Mod] CubeTheThird [ 26/Sep/13 ]

Is this still a concern in the current Minecraft version 1.6.4 / Launcher version 1.2.5 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Mustek [ 05/Feb/13 ]

Confirmed in 13w05b

Comment by Chalmes (Jon) [ 04/Nov/12 ]

After hitting the egg directly underneath me, the attached screenshot was the result.

Comment by Chalmes (Jon) [ 04/Nov/12 ]

When you hit a placed dragons egg and it teleports, the particles emitted often do not lead in the direction the egg moved. Nor away from. In fact, it seems a little inconsistent overall, and it would be good to have them pointing in the direction of travel.

Comment by [Mod] CubeTheThird [ 04/Nov/12 ]

Please clarify. What exactly is the bug here?

Generated at Sun Jan 12 11:56:54 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.