Changing a block on damage

Discussion in 'Plugin Development' started by Graype, Feb 7, 2011.

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

    Graype

    Heyy! I've just started development on plugins and i'm a bit confused on this subject.

    What I want to do is when ever the player hits/damages a Block, i want it to turn into Cake.

    Code:
    public void onBlockDamage(BlockDamageEvent event)
    {
             event.getBlock().setType(Material.CAKE);
    }


    but it crashs/errors.

    Thanks a lot!
     
  2. Offline

    Samkio

    I dont think the material works for cake yet.
    Instead use:
    Code:
     event.getBlock().setTypeId(92);
    :)
     
  3. Offline

    Graype

    Awesome! Thank you very much :]
     
Thread Status:
Not open for further replies.

Share This Page