Player Walks On Block Event

Discussion in 'Plugin Development' started by MyNameIsHariK, Nov 2, 2013.

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

    MyNameIsHariK

  2. Offline

    TomTheDeveloper

    Use the EntityMoveEvent or PlayerMoveEvent, I am not sure which one exists. Then you need to check the type of the block under the player. You also need to check if the player is "alive". Then do your teleportation.
     
  3. Offline

    Luloak2

    Code:java
    1. if(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getMaterial() == Material.REDSTONE) {
    2.  
    3. }


    Use this code in the events named above and it should work fine ;)
     
  4. Offline

    MyNameIsHariK

  5. Offline

    fromgate Retired Staff

    Luloak2 shows you the code. You just need to place it PlayerMoveEvent handler
     
Thread Status:
Not open for further replies.

Share This Page