How do I get Spruce log?

Discussion in 'Plugin Development' started by OppositeGamer, Feb 19, 2013.

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

    OppositeGamer

    I need to check if the log is either spruce burch etc. But it has one of those :3 values on the ID, any help?

    Code:
    Block block = event.getBlock();
            Player player = event.getPlayer();
            PlayerStats ps = new PlayerStats(player, plugin);
            ItemStack oak = new ItemStack(Material.LOG, 1, (short)0);
            ItemStack spruce = new ItemStack(Material.LOG, 1, (short)1);
            ItemStack birch = new ItemStack(Material.LOG, 1, (short)2);
           
            if(block == oak){
                ps.incWoodcutting(90);
            }
            if(block == spruce){
                ps.incWoodcutting(80);
            }
            if(block == birch){
                ps.incWoodcutting(70);
            }
     
  2. Offline

    chasechocolate

    block.getData()?
     
  3. Offline

    ZeusAllMighty11

    Block != itemstack AFAIK, so your code would not work
     
Thread Status:
Not open for further replies.

Share This Page