How to cancel the explosion when the Wither reaches full health?

Discussion in 'Plugin Development' started by MistPhizzle, Oct 28, 2012.

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

    MistPhizzle

    In 1.4, when a Wither reaches it's full health an explosion effect occurs and the surrounding land is destroyed. I'm working on my plugin 'StopWitherSpawns' which will be renamed to a more vague WitherManagement.

    I have successfully stopped WitherSkulls from dealing terrain damage upon impact, but I can't find how to cancel the explosion from the Wither itself. What event would I need to cancel to do this?

    Thanks in advance.
     
  2. Offline

    flyingtacoz

    Code:
        @EventHandler
        public void onBlockDamageByWitherExplode(EntityExplodeEvent event){
                    if(event.getEntityType() == EntityType.WITHER){
                        List<Block> blocks = event.blockList();
                        event.blockList().removeAll(blocks);
                    }
                }
     
  3. Offline

    MistPhizzle

    Tried this with no luck. Spammed my console with an NPE on lines 63 and 72 of my code.

    Here is my class in question: https://github.com/MistPhizzle/Stop...hizzle/stopwitherspawns/StopWitherSpawns.java

    Thanks for the help though, Any additional help is extremely appreciated.
     
  4. Offline

    flyingtacoz

  5. Offline

    MistPhizzle

    Not even sure why I didn't think of that before. Fixed. Thank you so much!
     
Thread Status:
Not open for further replies.

Share This Page