WorldGuard API Help!

Discussion in 'Spigot Plugin Development' started by XZot1K, May 6, 2015.

  1. Hey all im working on a piece of code that clears a explosions blocklist (Cancels It) If Its In A Region With The Stateflag TNT: deny heres my code right now what am I doing wrong :(

    This Code is in a EntityExplodeEvent
    Code (Text):
            if (plugin.worldguard) {
             
                if (!plugin.allowsTNT(e.getEntity().getLocation(),
                        e.getEntity().getWorld()).booleanValue()) {

                    e.blockList().clear();
                    e.setCancelled(true);
                    return;

                }

            }
     
  2. @JKMODz there probably isn't enough code for us to figure out the issue. But that aside, have you debugged your code? (What is the value of plugin.worldguard? what does plugin.allowsTNT return?)

    Also, use boolean rather than Boolean (the return type of allowsTNT seems to be Boolean).
     
  3. I figured it out ty though :)