Is there an event thing that lets you detect if a player is using a portal to go to the end or nether? Because on my server i made a serperate survival world for the players and they cant get tot he end or nether from that world. So i need to code something or find a plugin that enables this to be used. Thanks
PlayerTeleportEvent ( i think) and check if the teleportcause is nether_portal Ty Cleere, http://jd.bukkit.org/rb/apidocs/org/bukkit/event/player/PlayerTeleportEvent.TeleportCause.html EDIT by Moderator: merged posts, please use the edit button instead of double posting.
spoljo666 sgavster Thanks guys! I tho this was gonna work but it isnt working? can you guys look at it? Code:java @EventHandler public void nether(PlayerTeleportEvent e) { Player p = e.getPlayer(); World nether = Bukkit.getWorld("OneShotHub_nether"); World end = Bukkit.getWorld("OneShotHub_the_end"); if (e.getCause() == TeleportCause.NETHER_PORTAL) { p.teleport((Location) nether); } if (e.getCause() == TeleportCause.END_PORTAL) { p.teleport((Location) end); } } EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Ty Cleere, maybe you forgot to register that event? Try e.setCancelled(true); before teleporting them ... If nothing of that worked, try to add some debug messages.
spoljo666 Im about to test that now spoljo666 Ya that does nothing. And i put in a debuging message and it doesnt send. I can get to the nether form the main world but not the world im wanting. And the debuging message wont show up. EDIT by Moderator: merged posts, please use the edit button instead of double posting.