Remove fire

Discussion in 'Plugin Development' started by BloodBacker, Oct 9, 2014.

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

    BloodBacker

    Hello!

    I have a question, how to remove all fire in the world... with one command..

    Thnx ;p
     
  2. BloodBacker What bit are you not sure how to do? World has a getEntities() method. If you're not sure how to make commands, I recommend that you follow the plugin tutorial on the Bukkit wiki.
     
  3. Offline

    fireblast709

    BloodBacker loop over all blocks in the world and set all fire blocks to air (though, I suggest you don't do it like this since it will most likely kill your server).
    AdamQpzm last time I checked, fire was still a block ;3.
     
    AdamQpzm likes this.
  4. fireblast709 likes this.
  5. Offline

    BloodBacker

    fireblast709 how to loop over all blocks.. ?

    AdamQpzm I know how to use commands..

    AdamQpzm
    @fireblast709
    We could save it to a list? like, when a player use flint and steal, put the block/ idk what flint and steal is, to the list. After the game, you check if the block is fire, if it is fire, set it to air?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  6. Offline

    Hilgert

    remove or disable?
    disable code:
    Code:java
    1. @EventHandler
    2. public void onIgnite(BlockIgniteEvent e) {
    3. e.setCancelled(true);
    4. }
     
  7. Offline

    BloodBacker


    Remove... any idea?
     
  8. Offline

    Hilgert

    WorldGuard cmd: disable all activity: /stoplag, enable: /stoplag -c
    :)
     
  9. Offline

    BloodBacker


    Thats not what i'm searching...
     
  10. Offline

    teej107

    BloodBacker
    You can use that event to log fire locations. Then loop through those locations to check if they are still fire (I'm sure there's an event you could use when fire goes out to take it out of the log, then you wouldn't have to check if the block is still fire), then set to air.
     
  11. Offline

    BloodBacker


    Do i need to use a hashmap or arraylist, blockstate/block what?
     
  12. Offline

    Code0

    I'd use the event Hilgert so kindly provided and extend it. Whenever something ignites, loop over all blocks in a radius of 5 and if they're fire, set them to air. BloodBacker
     
  13. Offline

    teej107

    You can use a List/Set (preferably a Set). When a block ignites, add the location to the Set.
     
  14. Offline

    BloodBacker


    Like this:

    Code:java
    1. public List<Location> fire = new ArrayList<Location>();
    2. @EventHandler
    3. public void onIgnite(BlockIgniteEvent e){
    4. if (e.getCause().equals(IgniteCause.FLINT_AND_STEEL)){
    5. this.plugin.fire.add(e.getBlock().getLocation());
    6. }
    7. }


    And than, after the game? how to set all fire blocks to air, like timer or someting?
     
  15. Offline

    teej107

    BloodBacker Loop through the locations. Set the block to air if they are still fire.
     
  16. Offline

    BloodBacker


    Got it, thnx man!
     
Thread Status:
Not open for further replies.

Share This Page