Code Error

Discussion in 'Spigot Plugin Development' started by BenThunder, May 8, 2015.

  1. A. You haven't defined a world in the location.

    B. Can you show the stacktrace?
     
  2. 1. Use naming conventions
    2. You may not have interacted with a block
    3. The block you may not have interacted with may not be a Sign
    4. Sign is not a Block subclass
    5. The constructor you are using for Location does not exist
     
  3. Ok what do I need to do to fix it though in basic form?
     
  4.  
  5. You need to make add a world to your constructor.

    In this case get the players world.

    Code (Text):
    p.getWorld();
     
    • Like Like x 1
  6. Also to add to @Skionz comment. Recheck your if-statement. (here's some help about them)
     
  7. O my gosh I totally forgot about the else :p
     
  8. *facepalm*
    Look again
    'player' does not exist.
     
  9. Sorry I forgot to delete the else I was just going to say that.
     
  10. your if statement still is not correct. You put a semicolon where there should be none and are either missing curly brackets or your spacing is off.
     
  11. Spacing doesn't matter I think
     
  12. Ok then my habbit might not be needed but at least it makes it more readable :p

    And also as said already Sign is not a Block.

    Sign is a BlockState
     
  13. It's really hard to read your code if you don't follow code conventions.
     
    • Agree Agree x 1
  14. To fix the problems that you are having:
     
  15. Inkzzz

    Resource Staff

    Defining the player could be helpful!
     
  16. Ok so first off I do space my code I just read it better when I don't have a lot of them that is just me though. I am going to restart my online java class because it has been a long time since I have done it and I need a refresh. :) This is so I can get a better understanding of it.