Am i doing this right... no...

Discussion in 'Plugin Development' started by welsar55, Mar 2, 2013.

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

    welsar55

    im just trying to make you climb walls and this is what i have under a playermoveevent
    Code:
    if(player.getLocation().getBlock().equals(Material.AIR) && player.getEyeLocation().getBlock().equals(Material.AIR))
                {
                    player.sendBlockChange(player.getLocation(), Material.VINE, (byte) 0);
                    player.sendBlockChange(player.getEyeLocation(), Material.VINE, (byte) 0);
                }
    but nothing happens and yes the event does work
     
  2. The event may be working but your condition is not.
    You're checking if a Block class is equal to a Material class, that will never happen.
    Use block.getType() == Material.AIR or block.getTypeId() == 0.
     
  3. Offline

    welsar55

    ty that works but now im having more problems when you jump around and stuff the vines are still there... and i dont want the vines to stay there after you climbed them know a fix?
     
  4. You must send another block update to set them back to air.
    They won't stay for long though, they'll dissapear when the player reconnects or some block/chunk update occurs.
     
  5. Offline

    welsar55

    when would be a good time to update it how do i test if there still there i dont want to remove them if there still there
     
  6. You're not setting an actual block in the world so you can't test if it's there, it's all client side.

    You could keep a small limited list for each player to keep track of where you sent vines at and as soon as player is no longer within that location send a block update and remove the location from the list.
     
Thread Status:
Not open for further replies.

Share This Page