Detecting When Players Enter A World (not joins)

Discussion in 'Plugin Help/Development/Requests' started by ~NOVA~, Jul 16, 2017.

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

    ~NOVA~

    I'm using Multiverse (I don't know if it makes a difference) and I have been trying to send the player a message when they enter a specific world. It shouldn't be when the player joins and happens to be in that world(so it can't be PlayerJoinEvent), it should be when the player teleports into that world. Any suggestions?
     
  2. Offline

    Machine Maker

    @~NOVA~
    Use PlayerTeleportEvent.
    Check if the world the player left is different than the one he went to. And then check if he went to that specific event.
     
  3. Offline

    Zombie_Striker

    @X1machinemaker1X @~NOVA~
    Or just use PlayerChangedWorldEvent, and check if the player's current world (Player#getWorld) is equal to the specific world.
     
  4. Offline

    Machine Maker

    @Zombie_Striker I swear I searched for ChangedWorld on the java docs cause I was sure there was an event. Whoops:p
     
  5. Offline

    ~NOVA~

    Great thanks! I'll try that soon.
     
Thread Status:
Not open for further replies.

Share This Page