Help with multiple commands

Discussion in 'Plugin Development' started by militiaspack, Dec 15, 2013.

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

    militiaspack

    I wanna figure out how to do multiple commands so if i wanted to do /lightning rod and get something and then do /waterrod and get something different but my code is not working. Any help?

    pastebin link - http://pastebin.com/KhPBzcj6
     
  2. Offline

    AoH_Ruthless

    militiaspack Your bracket placement is horribly off. Review your code, and please utilize the Java syntax code tag or paste your code via pastebin. Just edit your post with a link or the Java syntax instead of creating a new one.
     
  3. Offline

    militiaspack


    Alright heres link http://pastebin.com/KhPBzcj6
     
  4. Offline

    AoH_Ruthless

    1. Remove the following (Pastebin #71):
    Code:java
    1. {}


    2. Your waterrod command is nested into your lightning rod. You want to close the lightning rod block with a closing bracket before checking a new command name. Example:
    Code:java
    1. { //Bracket 1 Opening
    2. {//Bracket 2 Opening
    3.  
    4. }//Bracket 2 Closing
    5. }//Bracket 1 Closing
    should become:

    Code:java
    1. {//Bracket 1 Opening
    2. //code here (lightning rod)
    3. //Add a return statement, since we are in a boolean method.
    4. }//Bracket 1 Closing
    5.  
    6. {//Bracket 2 Opening
    7. //Different, unrelated code (waterrod)
    8. //Add a return statement (we are in a boolean method) after the water rod code
    9. }//Bracket 2 Closing
     
  5. Offline

    militiaspack


    Alright so like this? http://pastebin.com/suZs6inh
     
  6. Offline

    AoH_Ruthless

    militiaspack
    Remove line 74, then remove line 60.
    You seem to not have a grasp on the fundamentals of Java. I suggest you work with Java first before 3rd Party API's.
     
Thread Status:
Not open for further replies.

Share This Page