I recently came across a problem where, in fixing something else by copying region files, a couple of the End Gateways in my Survival game stopped working as designed; instead they dumped me in the void to eat vacuum.

Is there a way to fix the End Gateway portals that are misbehaving, or do I just have to live with taking another portal that still works?

Information: this was in Minecraft 1.12.2 Java Edition, in a single user world. I should also add the OS on all my computers is Linux.


I don't know if there is a better way to do this, but I worked out the following by looking at Youtube videos about custom portals. It involves using commands, so in survival you have to temporarily enable cheats to do it.

First, make a backup of your entire world directory, in case something goes wrong!

Make a note of the coordinates of the portal(s) that are not working correctly. You can do this very easily using f3 and pointing at the portal. Possibly not quite so easy is to find the coordinates of the return portal. If you can use another portal to travel there you can use f3 in the same way to find its coordinates. Alternatively if you have a backup of your world you may be able to use that to find the right coordinates, or you can find an alternative 'safe' place to point the portal to. You may find @Fabian's tips in the comments below this answer useful to get the coordinates.

Turn on cheats by opening your world to LAN (ESC, then Open to LAN, toggle Allow Cheats: ON and then Start LAN World).

Use the following sequence of commands (coordinates for the portal are x, y, z; coordinates for the destination are m, n, o):

/setblock x y z air 0 replace
/setblock x y z end_gateway 0 replace {ExitPortal:{X:m,Y:n,Z:o},ExactTeleport:0}

The first line deletes the malfunctioning gateway block at x, y, z and replaces it with air. I found this was necessary because I could not directly replace the gateway block with another one. Without this you just get a message to say the block was not placed.

The second line places a new gateway block in the same location, and points it to teleport to coordinates m, n, o, with the 'normal' end gateway behaviour.

Save your game and restart it to close the LAN, and the portal should now work.

If you are unable to find the correct coordinates for the destination, it may be safer to find another place to use as the teleport target, and use ExactTeleport:1.

| improve this answer | |
  • "not quite so easy is to find the coordinates of the return portal"? Why? It's always at x=0 and z=0 on the ground and you can find out the same way as for the overworld portal. – Fabian Röling Jan 9 '18 at 13:53
  • Wait, are you talking about end gateways or the end portal? I kept wondering how in the world an end portal can break and how replacing it with air and back with a portal would help anything, because it's not even a tile entity. If you mean "end gateway", please use that term consistently. – Fabian Röling Jan 9 '18 at 13:54
  • Just the third command should be enough, you don't need #1, #2 and #4. Did you test going through without using command #2? – Fabian Röling Jan 9 '18 at 13:55
  • @Fabian you got it, this is about the gateways to the islands. – Bobble Jan 9 '18 at 13:56
  • 2
    Tip: You can find the intended way out by using "recreate world" and then going through the gateway. To get the gateway, you just have to enter /setblock ~ ~ ~ end_portal to go to the end and then /kill @e[type=ender_dragon] to kill the dragon and generate the gateway. – Fabian Röling Jan 9 '18 at 14:00

In this situation I would save a copy of the map, then use an external editor (MCEdit, for example) to delete the chunks for the end in the copy. That would force the chunks to repopulate on entering the portal. If that doesn't work, maybe replace the active portal by pasting over it with one that has not yet been activated, then in game reactivate the portal. if neither method works, try both? if you've already defeated the dragon and/or have things built in the end, this method wouldn't be advisable.

| improve this answer | |
  • This is a good idea, but it was not an option for me because my OS is Linux and MCEdit does not work there AFAIK. NBTExplorer sort-of enables you to look at things, but I found previously all sorts of issues actually editing things with it running under Mono. Also, the reason I was messing around copying region files in the first place was because deleting them did not resolve the original problem, which was to do with failed/damaged creation of end cities. – Bobble Jan 10 '18 at 10:02
  • @Bobble well, there is MCEdit for Linux, and there is Wine, soo... – Manchineel Feb 5 '18 at 12:33
  • @alex2003super I'm always using the windows version, and it's been a while. I had completely forgotten about there being a Linux version of MCEdit. – Jonathan Feb 5 '18 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.