Solved [SEVERE] Could not pass event... but no errors in the .java file? help! :(

Discussion in 'Plugin Development' started by tom1000o, Oct 29, 2012.

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

    tom1000o

    I figured it out!
    instead of:

    Code:java
    1. World world = event.getEntity().getWorld();
    2. Location location = event.getEntity().getLocation();


    i used:

    Code:java
    1. Location location = event.getLocation();
    2. World world = event.getLocation().getWorld();


    the problem:
    i used getEntity() when storing the world & location, all i needed was getLocation() and getWorld(). thanks to everyone who helped me :)
     
  2. Offline

    Woobie

    Code:
    Caused by: java.lang.NullPointerException
            at com.gmail.thomas.mcnamarajr.WitherNerf.WitherNerf.boom(WitherNerf.jav
    a:32)
    Line 32 is?
     
  3. Offline

    tom1000o

    ah. i should look over the errors more closely, but i still don't see how its an error.. :p
    EDIT: if i remember right, nullPointerException is what happens when you try to use a value thats null... hmm
    EDIT 2: i dont get it! its working perfectly but the console error isn't going away!

    Code:
    World world = event.getEntity().getWorld();
    world.createExplosion(location, 0);
    also, is there a way to format the code box for java? ^^^ ive seen other posts with a dark background that do this.
     
  4. Offline

    Timr

    Wrap your code in [ syntax=java][/syntax ] block tags.

    Is there something you're not showing us? I threw the code into NP++ and line 36 is the closure of a void
     
  5. Offline

    tom1000o

    looking back i noticed i left out 2 blank lines above the package notation, other then that you see everything i see :s ill go throw that in the main post. Any help on this is much appreciated..i just cant figure it out.

    Code:java
    1. and thanks :)
     
Thread Status:
Not open for further replies.

Share This Page