Solved How to make a class that listens for a argument

Discussion in 'Plugin Development' started by NightmareFox, Sep 3, 2021.

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

    NightmareFox

    In my plugin i want to make a listener that listens for an argument.

    I have the commands class that has the main command /example and it checks if the sender is a player and checks if there are arguments.
    Now i want to do this

    If (args[0].equals("arena")) {
    // argument listener
    }

    How do i make the listener for it and make it work
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    NightmareFox

    I asked this wrong.

    I want to check arguments in a diffrent class
    Example.

    If (args[0].equals("arena")) {
    // check arguments from diffrent class
    }

    I do not now how to explain it

    Basically if a user executes /example create i want to load functions from arena.create class
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    NightmareFox

    Ok imma try something diffrent.
    I can't explain correctly.
    Thanks for trying tho

    Wait i found a way


    1. f (args[0].equalsignorecase("arena")) {
      ArenaCommands.method().

      }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 3, 2021
  6. Offline

    timtower Administrator Administrator Moderator

    @NightmareFox Which is making a method in a different class -.-
     
Thread Status:
Not open for further replies.

Share This Page