Solved How to make a class that listens for a argument

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

  1. Offline


    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


    I asked this wrong.

    I want to check arguments in a diffrent class

    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


    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")) {


    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 -.-

Share This Page