Solved Java error

Discussion in 'Plugin Development' started by thomasb454, Jul 2, 2013.

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

    thomasb454

    You are probably going to say "learn Java" I am!

    Well, I'm adding an unban command to my plugin.

    On this line of code:
    Code:
                OfflinePlayer player = (Bukkit.getServer().getOfflinePlayer(args[0]);
    I get this error:
    http://prntscr.com/1d6u5h

    But, if I do as it says, I get this error:
    http://prntscr.com/1d6um7

    Thanks in advance,
    Thomas.
     
  2. Offline

    ProtoTempus

    @thomasb454
    Code:java
    1. OfflinePlayer player = Bukkit.getServer().getOfflinePlayer(args[0]);


    EDIT: The unreachable code error is coming from the code around this line. We'll need to see that to help you.
     
  3. Offline

    thomasb454

  4. Offline

    ProtoTempus

    thomasb454 The unreachable code error is coming from the code around this line. We'll need to see that to help you.
     
  5. Offline

    MP5K

    //i just go ninja'd :D
    Hello thomasb454,
    The "Unreachable code" means that your code is never going to be executed because you return or abort the method before. e.g. with an "return [object];" or an "throw <exception>;" statement.
     
  6. Offline

    thomasb454

    MP5K Wow, I feel like an idiot, as I said I'm still learning but I should of spotted that.

    SOLVED.

    ProtoTempus It's ok now.
     
  7. Offline

    MP5K

    you don't have to because everyone started learning java at some point.
    so its pretty normal to make mistakes like that. :3
     
Thread Status:
Not open for further replies.

Share This Page