How to change end exit/enter portals locations?

Discussion in 'Spigot Plugin Help' started by VZlomka, Jan 26, 2021.

  1. Hi,

    is there a way to change the spawn location in the end when a player enters the portal in the regular world?
    is there a way to change spawn location in the regular world when a player exits the end world by a portal?
     
  2. When a player goes through an End portal, it most likely teleports him/her/it to the Bed location (Player#getBedLocation), if the bed location is null, it teleports the player to the world spawn.

    What you want to do, is listen to PlayerChangeWorldEvent, PlayerPortalEvent or PlayerTeleportEvent and teleport the player accordingly.
     
  3. There are 2 things I want to do.

    1) When you find a natural generated end portal in the overworld and enters it, I want to change the location where players spawn in the end.
    2) When a player kills the dragon for example and enters the exit portal, I want to change the spawn location.

    Beds or death has nothing to do with this.