Solved tnt destroy obsidian on certain hits?

Discussion in 'Plugin Development' started by BeastCraft3, Dec 22, 2014.

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

    BeastCraft3

    Greetings people, I'm wondering how to make tnt destroy obsidian on 8 hits.
    I don't know which eventhandler I should use for this. Please help me
     
  2. Offline

    Skionz

    @BeastCraft3 Use the EntityExplodeEvent, iterate through the blocks, add the blocks that are obsidian to a Map.
     
  3. Offline

    mine-care

    Well listen to entity explosion event and keep a map with all locations and times they where hit by explosion of it is the 8th break iT

    EDIT ninjaed
     
    Skionz likes this.
  4. Offline

    BeastCraft3

    @Skionz @mine-care
    emm, ok.
    How would I add like

    Enable in worlds:
    - world

    inside the config??
    I know it has something to do with boolean right?
     
  5. Offline

    Skionz

    @BeastCraft3 Booleans? I guess since you need booleans to use control flow statements.
     
  6. Offline

    BeastCraft3

    @Skionz
    right, cause that gave alot of sence :p can you show some example code or tell me what to do more detailed?
     
  7. Offline

    Skionz

    API_Tutorials likes this.
  8. Offline

    BeastCraft3

    @Skionz
    like this?
    Code:
    if(main.getConfig().getBoolean(worlds, true)) {
               
            }
     
  9. Offline

    Skionz

    Last edited: Dec 22, 2014
  10. @BeastCraft3 If you want to do it in the format of:
    Enable in worlds:
    - worldName
    - worldName2

    Then you would check if the entity is in that world. Get the list by retrieving it using the ConfigurationAPI (getConfig()) and check if the world where the entity is exploding is inside that list.

    The only way you'll need a boolean is to check if the world's name is listed in the config or not.
     
  11. Offline

    BeastCraft3

  12. Offline

    Skionz

    @BeastCraft3 Note that your still going to have to use control statements and booleans even if you skip it.
     
  13. @BeastCraft3 It isn't that difficult... I'm probably over-complicating things.
     
Thread Status:
Not open for further replies.

Share This Page