Check for a certain block around a block?

Discussion in 'Plugin Development' started by EpicBlargh, Oct 9, 2012.

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

    EpicBlargh

    Let's say I have a pressure plate. When I step on it, it checks if there is a Lapis Lazuli Block 2 blocks underneath of it. How do I do this?

    Don't worry about the pressure plate part, I already have that. Here's the event if it helps.

    Code:
    if(event.getClickedBlock().getType() == Material.STONE_PLATE){
                //Something here
            }
     
  2. Block twoBlocksbelowThePlate = event.getClickedBlock.getRelative(BlockFace.DOWN, 2);
     
  3. Offline

    EpicBlargh

    Awesome! Everything but your variable worked though.
     
Thread Status:
Not open for further replies.

Share This Page