Solved blocking block placement

Discussion in 'Plugin Development' started by mastermustard, Feb 14, 2013.

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

    mastermustard

    how would i block the placement of water and lava. the code below only works for blocks :/

    Code:
    if(event.getBlock().getType() == Material.LAVA){
    event.setCancelled(true);
    and yes ive tried placing with the lava bucket and the actual block id itself (11)
     
  2. Offline

    finalblade1234

    To stop Lava Placement:
    (this is on BlockPlaceEvent)
    Code:
    if(event.getBlock().getTypeId() == 10 || event.getBlock().getTypeId() == 11){
    event.setCanceled(true);
    
    And For Using Lava Bucket

    Code:
        public void onPlayerUseBukkitEvent(PlayerBucketEmptyEvent event){
            if(event.getBucket() == Material.LAVA_BUCKET){
                event.setCancelled(true);
            }
    Note: Please dont use code you cant understand... so if you cant understand some of this Just ask, ill be happy to help
     
Thread Status:
Not open for further replies.

Share This Page