Need help with teleporting block!

Discussion in 'Plugin Development' started by emberbane, Feb 6, 2014.

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

    emberbane

    Hello, The only issue i'm having with this is that everytime it teleports a player into water i want it to teleport them again, So the lines
    Material m = e3.getPlayer().getLocation().getBlock().getType();
    if (m == Material.STATIONARY_WATER || m == Material.WATER) {
    player.teleport(Teleport1);
    }
    are not not working, i'm getting no errors in eclipse.
     
  2. Offline

    Engfr546

    emberbane
    Please type in all your code, so that can understand where Teleport1 is,and any errors.
     
  3. Offline

    xTrollxDudex

  4. Code:java
    1. if (m == Material.STATIONARY_WATER || m == Material.WATER) {
    2. player.teleport(Teleport1);
    3. }


    Won't work use code below instead

    Code:java
    1. if (m.equals(Material.STATIONARY_WATER) || m.equals(Material.WATER)) {
    2. player.teleport(Teleport1);
    3. }
     
  5. Offline

    Engfr546

    emberbane
    What event is it under?
    Try player.teleport(x , y , z).
     
Thread Status:
Not open for further replies.

Share This Page