[SOLVED] PLAYER_PORTAL event fails

Discussion in 'Plugin Development' started by bergerkiller, Jul 24, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    bergerkiller

    I am trying to teleport the player to a different Portal based on a Sign that is near (and registered).
    Everything works, but I can't seem to make the PLAYER_PORTAL event fire at all...
    Code:
        @Override
        public void onPlayerPortal(PlayerPortalEvent event) {
            System.out.println("PORTAL!");
        }
    Code:
    pm.registerEvent(Event.Type.PLAYER_PORTAL, playerListener, Priority.Highest, this);
    Anyone knows what could be wrong? I don't want to handle the PLAYER_MOVE for something this simple...

    EDIT

    It requires the hell setting to be enabled...sigh. Any workaround for this?
     
  2. Offline

    caHarkness

    Did you register the listener for PLAYER_PORTAL? Also, I never messed with it, but could this event actually just trigger on entering the Nether through the portal?
     
  3. Offline

    bergerkiller

    Yeah it seems to be that is the case. It only fires if I enable hell on my server...
    I have no problem with teleportation to hell if it has no sign near, but I don't feel like restricting hell for my plugin to work...Players stay in the same world. (Although cross-world teleportation is possible)

    I'll check if a portal block is near a player in the onPlayerMove event...for now.
    Would allow instant teleportation, which is actually even better. :)
     
  4. Offline

    Hretsam

    You also got an entityPortalEnter event, which is also send when a player enters a portal, you can try to use that.
     
  5. Offline

    bergerkiller

    Wow, thank you! ;)
    This is exactly what I needed; less laggy and almost instant!

    I always take mobs as entity, it can backfire now and then. [fire]
     
Thread Status:
Not open for further replies.

Share This Page