How can I convert blocks in air waiting 6 seconds using runnables?

Discussion in 'Plugin Development' started by ItzDCraft_, Feb 16, 2018.

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

    ItzDCraft_

    Hello everyone, I'm newbie here of the "Developing" and my Developer has created a FFA plugin, but his pc has broken and he can't finish it.
    I was recoding the FFA plugin and I have to conver Obsidian & CobbleStone in air waiting 6 seconds, but I don't know how to do that.
    I'm waiting a reponse, thanks.
    Also, sorry for the bad English, I'm totally Spanish.
     
  2. Offline

    RcExtract

    There are many blocks in a world, so i dont suggest u to loop through all blocks, validate that they are obsidian or cobblestone and start a task. Try to handle the BlockPlaceEvent, and add the Block object to the a HashMap, if it is obsidian or cobblestone, along with an int of 6. Then, start a synchronous repeating thread, make it run every second. Every second u want to decrease the values in the HashMap by 1. If some reaches 0, get the key of the int, which returns a Block object, and set the material of the block to air.
     
  3. Offline

    ItzDCraft_

    Ok I'll try it.
    Thanks for the review.
     
Thread Status:
Not open for further replies.

Share This Page