Changeing wheat state

Discussion in 'Plugin Development' started by Alex5657, Jul 1, 2012.

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

    Alex5657

    Hey guys,
    I need help with changing wheat state when planted so i made a block listener to listen when the block is placed and check if its crops. If it is it has to change it to grown crops. Can any1 tell me how do input the value of the crops state?
     
  2. Offline

    lpoulter

    Did you have any luck with this? I'm struggling with the same proplem.
     
  3. Offline

    Njol

    lpoulter likes this.
  4. Offline

    NerdsWBNerds

    Alex5657 lpoulter

    Code:
    @EventHandler
    public void cropPlaces(BlockPlaceEvent e){
        System.out.println(e.getBlock().getType().name());
     
        if(e.getBlock().getType() == Material.CROPS){
            e.getBlock().setData((byte) 7);
        }
    }
    
     
    lpoulter likes this.
  5. Offline

    lpoulter

    Excellent thanks for this guys.
     
Thread Status:
Not open for further replies.

Share This Page