Prevent water turning lava into Obsidian?

Discussion in 'Plugin Development' started by DoctorDark, Feb 1, 2014.

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

    DoctorDark

    Would there be any way to prevent any water placed onto lava cancelled listening to BucketEmptyEvent? I have tried getting the block, then the type but if the water is placed a block below for example then it wont work.

    Thanks
     
  2. Offline

    Flybelette

    Look if the Water block is placed on top of Lava/Anything and then remove the block, and change the block that was created, Example : A water block is placed on top of a lava one, Check the type of the created block, if it's Obsidian, change it to lava. Hope you understand ^^
     
  3. Offline

    DoctorDark

    And how do I check the block the water was placed on?
     
  4. Offline

    Flybelette

    Code:java
    1. @EventHandler
    2. public void onPlayerPlaceBlock(BlockPlaceEvent e){
    3.  
    4. int X = e.getBlock().getLocation().getBlockX();
    5. int Y = e.getBlock().getLocation().getBlockY();
    6. int Z = e.getBlock().getLocation().getBlockZ();
    7. World world = e.getBlock().getWorld();
    8. world.getBlockAt(X, Y-1, Z);
    9.  
    10.  
    11. }
     
  5. Offline

    Panjab

    DoctorDark

    Use the "BlockFromToEvent" and check if getBlock equals stationary_lava or flowing_lava (dunno how they're called) and if getToBlock equals Obsidian.

    Then just cancel it.
     
    DoctorDark likes this.
  6. Offline

    bennie3211

    Panjab what happends then if you keep the water on it? 20 times per second a cancel for 1 block?
     
  7. Offline

    Flybelette

    Did it worked ?
     
  8. Offline

    MrRedstone3000

    Ähm.. There is no "BlockChangeEvent"....
     
    Skionz likes this.
  9. Offline

    mrCookieSlime

Thread Status:
Not open for further replies.

Share This Page