Very strange error with teleport

Discussion in 'Plugin Development' started by Shevchik, Nov 15, 2013.

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

    Shevchik

    Currently i'm trying to fix some strange bug with SurvivalGames.
    And here is the problem.
    To detect player death plugin uses DentityDamageByEntity event and cancels it if health will be below zero after the damage and teleport player out of the arena and restores it state.
    Here it is
    https://github.com/Shevchik/Surviva...org/mcsg/survivalgames/events/DeathEvent.java

    But when it tries to teleport player nothing happens, player stays here. But his inventory is restored messages broadcasted, so everything exept teleport works
    https://github.com/Shevchik/Survival-Games/blob/master/src/org/mcsg/survivalgames/Game.java#L527

    Just... WHY???
     
  2. Offline

    amhokies

    It would be great if you could post the error. They usually will tell you exactly what is going on.
     
  3. Offline

    Shevchik

    There is no error. Player just stays where it was, teleport does not occur.
     
  4. Offline

    geNAZt

    Can you move after that ? I think a fix could be to remove the player from the MoveEvent (https://github.com/Shevchik/Surviva.../org/mcsg/survivalgames/events/MoveEvent.java) checks if the user is in a Game if so it checks the Gamestate and freezes the Player to its location.

    So i you Teleport the Player Bukkit could emit a Move Event which will be catched by this Listener. So remove the Player out of the Game before you teleport them.
     
  5. Is player.teleport() returning true or false, if its returning false, a other plugin denies the teleport, if it return true, he is teleported back to his orginal location after your teleport call
     
Thread Status:
Not open for further replies.

Share This Page