I deleted the portal to the end city in minecraft

minecraft-commandsminecraft-java-edition

I was messing around with my Minecraft world and accidentally deleted the portal on the main end island that leads to the first end city (don't ask me how)

End portal gone

Does anyone know how I can put it back? Or do I have to complete a new Ender Dragon fight?

Best Answer

You can beat the ender dragon again to spawn a new, different end gateway, yes.
Alternatively, you can use /setblock to create one in the place of the old one, as explained below.

From the wiki page:

  • The ExitPortal tag holds a set of X/Y/Z coordinates to determine the general location the player can be "safely" teleported to when entering.
  • Setting ExactTeleport to 1 teleports entities to the specified coordinates exactly instead of at a safer location around those coordinates.

Example:

/setblock ~ ~-2 ~ minecraft:end_gateway{ExactTeleport:0,ExitPortal:{X:1000,Y:90,Z:3000}} replace

This will create an end gateway 2 blocks underneath you that exits at 1000 90 3000.