Solved Cancel specific nether portal

Discussion in 'Spigot Plugin Development' started by zDoeProgram, Nov 23, 2021.

  1. Hey! I'm making an arena portal plugin for myself, and I really want to use the "NETHER_PORTAL" material inside my own portals between arenas. However, as I enter them I obviously get teleported to nether.

    My portal object contains a Set of Immutable locations, which I check with PlayerMoveEvent. So the portal blocks are only for "design" purposes. Is there a way to cancel the nether portal teleporation at these "custom portals" ?
     
  2. You can use the PlayerTeleportEvent. It has a method getCause() for information which type of teleport it is. Cancel the one's of type NETHER_PORTAL coming from your custom portals location.