mojira.dev
MC-121099

Entering a portal in a non-standard shape or made of a non-standard material places you below the portal on the other side

The bug

Portals that are made of a material other than obsidian or are not in a standard shape place the player below them on usage.

This can be a problem for custom maps that may want to use portals of a non-standard shape or material. This situation will not be encountered in normal survival gameplay.

The distance below depends on the height of the portal on the other end.

How to reproduce

  1. Download the attached test world

  2. Enter the portal with a normal obsidian frame

  3. Observe that you are teleported to the portal normally. Return to the overworld.

  4. Enter the portal with a quartz frame. This portal is an "invalid" state (if it were to receive a block update, the portal blocks would remove themselves), but something like this could be found in adventure maps.

  5. Observe that you are teleported far below the portal in the nether.

Code analysis

By @unknown, based on 1.12.2 decompiled using MCP 9.40. The problem is that in net.minecraft.entity.Entity.setPortal(BlockPos), invalid portals produce some unexpected (positive) values in lastPortalVec. A simple fix would be for net.minecraft.world.Teleporter.placeInExistingPortal(Entity, float) to place the entity in the bottom left corner of the destination portal if the values in lastPortalVec are invalid.

Linked issues

Attachments

Comments

No comments.

pokechu22

(Unassigned)

Confirmed

portal

Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w48a

Retrieved