Solved getting command return from chat

Discussion in 'Plugin Development' started by Guitarax, Dec 22, 2014.

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

    Guitarax

    I know it may not be a recommended method but I am trying to get a player's account balance via dispatchCommand().

    I have a dummy player setupup to "execute" command but I'm not sure how to get the data.

    CODE:

    Code:
    if(block == event.getClickedBlock()){
                            Player shop_dummy = null;
                            Bukkit.getServer().dispatchCommand(shop_dummy,"balance " + event.getPlayer().getName());
                            //get the balance return
                        }
    I'm trying to get the event player's account balance based on what essentially, (puns), /bal <playername> would return.

    Alternative methods are ok, so long as it works.
     
  2. Offline

    Skionz

    @Guitarax PlayerCommandPreprocessEvent or something along those lines.
     
  3. Offline

    ColonelHedgehog

    I think he means he wants to get the balance of the player.

    Do you mean you want to get the balance of the player? Most servers use "Vault" as an economy plugin—if that's what you're looking for.
     
  4. Offline

    teej107

  5. Offline

    _Filip

    If you can intercept the message from essentials to the console sender you can easily get the next message after dispatchCommand by something like boolean nextIsRead = true;
    Then on intercept if (nextIsRead) blah blah blah.
     
  6. Offline

    Techy4198

    Can't you just directly link to Vault? As far as I remember, they have an API built in.
     
  7. Offline

    Guitarax

    Linked to Vault, thanks for the help
     
Thread Status:
Not open for further replies.

Share This Page