Trying to make a Command Based application with Java (You were once a noob too, help a fella out)

Discussion in 'Plugin Development' started by Saykazay, Jan 21, 2011.

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

    Saykazay

    I'm trying to code my first plugin in Eclipse with Java, and decided you are who I should ask for help. I'm not going to disclose all ofthe details, instead, I am just going to ask for a bit of guidance.

    I want the plugin to be made so that every time player1 types /[command1] [item ID] [item amount] [Player], player2 (the receiver) gets the option of acceptance or denial of the item. I will use different text here, obviously.

    And secondly: How would I be able to make it so that every time that player1 got a certain item, the item would automatically go to player2 until player2 had given player1 a certain amount of the item?

    Thank-you for at least trying to help me.
     
  2. Offline

    Archelaus

    Code:
        public void onPlayerCommand(PlayerChatEvent event) {
            String[] splitmessage = event.getMessage().split(" ");
            if(splitmessage[0].equalsIgnoreCase("command")) {
    //Stuff to do
    }
    }
    This will start you off.
     
  3. Offline

    Saykazay

    And the part in the quatation marks, I replace that with my own text, correct?
     
  4. Offline

    Archelaus

    Yeah. You need to register it as an event too.

    It needs to have a / infront of it.
     
Thread Status:
Not open for further replies.

Share This Page