mojira.dev
MC-86850

Ender Pearling through a nether portal in the over-world tp's you to the portals nether coordinates but in the overworld

What i expected to happen was nothing as usual when throwing ender pearls into the Nether portal

What really happened was I got teleported in the overworld to that portal's Nether coordinates

This bug seems to not exist on worlds created in 1.9 but only in worlds created before, i tried on a world created in 1.8.3 and 1.8.8 and the bug happens, so to re-create you would have to create a world in 1.8 or below and then play it on 15w34b, build a nether portal and throw an ender pearl into it. Happens regardless of what version the world is generated.

Very finicky. For me, only happened when standing one block next to (but not inside) the portal, and throwing to a spot just one block on the other side. But not always. -- @unknown

See this comment by @unknown for suggested fix based on 1.10 MCP

Linked issues

MC-87134 Nether Pearling "Teleportation" Resolved MC-89314 server ender pearls and nether portals Resolved MC-92127 Throwing enderpearl into Nether Portal teleports user to coordinates of the Nether Portal in the other dimension in the dimension they're currently in. Resolved MC-99362 Enderpearl tossed in nether portal teleports to the coords from the overworld in the nether Resolved MC-101490 Dangerous nether portal bug Resolved

Comments 16

Confirmed for 15w43c.
Same thing happens when you do it in the Nether.

Confirmed for 15w44a.

Affects Version Minecraft 15w45a [ 15408 ]

Confirmed for 15w46a.

6 more comments

Confirmed for 16w15a. Was hard to even find this bug, since nobody seems to have checked it for a long time.

I would like to add that if you disconnect from a multiplayer server while in a portal, when you reconnect you will spawn in the nether with the coordinates you had in the overworld.

I'm thousands of blocks away from a valid portal. It seems that it's possible to have your overworld coordinates in the nether, and your nether coordinates in the overworld. Wasn't sue if this is worthy of it's own issue as these two issues are probably related.

Fix for 1.10 based on MCP:

diff --git a/src/minecraft/net/minecraft/entity/projectile/EntityThrowable.java b/src/minecraft/net/minecraft/entity/projectile/EntityThrowable.java
index e4c8044..1ab602e 100644
--- a/src/minecraft/net/minecraft/entity/projectile/EntityThrowable.java
+++ b/src/minecraft/net/minecraft/entity/projectile/EntityThrowable.java
@@ -125,60 +125,65 @@ public abstract class EntityThrowable extends Entity implements IProjectile
 
     /**
      * Updates the velocity of the entity to a new value.
      */
     public void setVelocity(double x, double y, double z)
     {
         this.motionX = x;
         this.motionY = y;
         this.motionZ = z;
 
         if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
         {
             float f = MathHelper.sqrt_double(x * x + z * z);
             this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
             this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI));
             this.prevRotationYaw = this.rotationYaw;
             this.prevRotationPitch = this.rotationPitch;
         }
     }
 
     /**
      * Called to update the entity's position/logic.
      */
     public void onUpdate()
     {
         this.lastTickPosX = this.posX;
         this.lastTickPosY = this.posY;
         this.lastTickPosZ = this.posZ;
         super.onUpdate();
 
+        if (this.isDead)
+        {
+            return;
+        }
+
         if (this.throwableShake > 0)
         {
             --this.throwableShake;
         }
 
         if (this.inGround)
         {
             if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile)
             {
                 ++this.ticksInGround;
 
                 if (this.ticksInGround == 1200)
                 {
                     this.setDead();
                 }
 
                 return;
             }
 
             this.inGround = false;
             this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
             this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
             this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
             this.ticksInGround = 0;
             this.ticksInAir = 0;
         }
         else
         {
             ++this.ticksInAir;
         }

Related to MC-98153, MC-89928, MC-90062. If these did not exist you would just be teleported through twice and arrive where you started I think.

To reproduce this easier, try to throw the ender pearl diagonally into the portal, preferably from the bottom of the portal up. The important thing is that the pearl (which is very fast) is inside any portal block for at least a few ticks (maybe one is enough, I don't know). It doesn't collide with the portal, so it flies through if the game doesn't notice that it's inside the portal fast enough and teleports it. But if it stays in the portal block for a few ticks, it definitely gets teleported. Maybe the reason why this is hard to reproduce is related to MC-4581.

James Prince

migrated

Confirmed

Minecraft 15w34a, Minecraft 15w34b, Minecraft 15w34c, Minecraft 15w34d, Minecraft 15w43c, ..., Minecraft 1.10 Pre-Release 2, Minecraft 1.10.2, Minecraft 16w39c, Minecraft 1.11.2, Minecraft 17w06a

Minecraft 1.12.2 Pre-Release 1

Retrieved