Nether Water Sizzle Event?

Discussion in 'Plugin Development' started by Daniel Heppner, Jul 21, 2011.

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

    Daniel Heppner

    I'm currently making a plugin that will let you place water in the nether, and the easiest way to do this would be canceling an event. If there's no event for this, how would I best go about figuring out where the water block should've been so I can change it to a moving water block?

    You'll be forever credited! :p
     
  2. Offline

    RedFoxRedI

    I haven't really thought about this problem before, but if you can figure out if any event at all is thrown while placing water in the nether, you could cancel it. I think at least there should be the event for interaction while you have the bucket of water in your hand and you try to place it.
     
  3. Offline

    bleachisback

    There's playerInteractEvent. Just make it so that when they right-click a block with a bucket of water, you change the block at the block face to water
     
  4. Offline

    cholo71796

    Code:java
    1. public void onPlayerInteract(PlayerInteractEvent event){
    2. if(event.getClickedBlock().getWorld().getEnvironment() == Environment.NETHER
    3. && event.getItem().getType() == Material.WATER_BUCKET) {
    4. event.setCancelled(true);
    5. event.getClickedBlock().getRelative(event.getBlockFace()).setType(Material.WATER);
    6. }
    7. }


    I don't know if water sizzles if placed by a plugin, but that would place water properly.
     
  5. Offline

    JoshuaBehrens

    Maybe you can use the BlockFromTo-Event
     
  6. Offline

    bleachisback

    That's when water flows, so it wouldn't trigger a BlockFromToEvent
     
  7. Offline

    LRFLEW

    Well, since placing water blocks as players (instead of releasing a bukkit) WILL work in the nether, I have no doubt that a plugin can to the same.
     
  8. Offline

    cholo71796

    @Daniel Heppner Well, there you have it. My code should work just fine.
     
  9. Offline

    ParkerReno

    It is spelled "bucket" when not talking about the server mod.
     
  10. Offline

    cholo71796

    Yeah, his misspelling/misuse horribly confused me. I thought "releasing a bukkit" was shorthand for "releasing a new Bukkit build," throwing me way off track. Now I understand. My code should work then.
     
    ParkerReno likes this.
  11. Offline

    loganwm

    Just chiming in on a vaguely relevant note: I've caught myself on at least a dozen occasions using "bukkit" in place of "bucket" in the past week. It grows on you.
     
    Daniel Heppner likes this.
Thread Status:
Not open for further replies.

Share This Page