Check if block is birch wood planks?

Discussion in 'Plugin Development' started by beanonaboard, Mar 13, 2014.

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

    beanonaboard

    Hi I have been checking the block underneath using

    Code:java
    1. if (p.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() != Material.QUARTZ_STAIRS){
    2.  


    But how would I check it for birch wood planks would I need to get the durability for it?
     
  2. Offline

    AoH_Ruthless

  3. Offline

    beanonaboard

    would you be able to give me an example please could I cannot get it to work
     
  4. Offline

    AoH_Ruthless

    beanonaboard
    What have you tried? Paste your code so we can see what you've accomplished so far :)
     
  5. Offline

    beanonaboard

    Currently all I have got is this I really am stuck when it comes to getting the wood type

    Code:java
    1. p.getLocation().getBlock().getState().getData().getData();
     
  6. Offline

    AoH_Ruthless

    beanonaboard
    Code:java
    1. Block b = p.getLocation().getBlock();
    2. if (b.getType() == Material.WOOD && b.getDurability() == 2) { //I think it's Wood, and birch is data 2
    3. //code
    4. }
     
    beanonaboard likes this.
Thread Status:
Not open for further replies.

Share This Page