PlayerChangedWorldEvent get previous data

Discussion in 'Plugin Development' started by iSexyChocobo, Jul 9, 2015.

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

    iSexyChocobo

    I'm experiencing this weird glitch where the player's exp seems to reset per world.. It's unintentionally caused by some other plugin, but that's besides the point.

    I am trying to combat this by comparing the player's exp BEFORE a world switch and the one AFTER a world switch. However, PlayerChangedWorldEvent seems to only offer AFTER the switch has happened.

    How do I achieve this? Is there some kind of pre-playerchangedworld event ?
     
  2. @iSexyChocobo
    Try the PlayerTeleportEvent, it happens before a player teleports, so you could check if it's a different world and then maybe store the XP in a map, and then at a PlayerChangedWorldEvent you return the XP from the map.
     
Thread Status:
Not open for further replies.

Share This Page