Plugin Help Playernames in commands?

Discussion in 'Plugin Help/Development/Requests' started by TheDiamond06, Dec 26, 2014.

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

    TheDiamond06

    So I am trying to make it so the player dispatches a command with his/her name in it.
    This is what I tried to do:
    Code:
                        Bukkit.dispatchCommand(p, "TokenEnchant add " + p.getName() + "1");
                        Bukkit.dispatchCommand(p, "TokenEnchant withdraw 1");
    
    When I do this, In-game it says:
    [TE] Error: /tokenenchant add <name> <amount>
    [TE] You do not have enough tokens.
     
  2. Offline

    mrCookieSlime

    @TheDiamond06
    You forgot a space before the amount.
    Your 1 is directly attached to your Username.
    So you are doing
    /tokenenchant add mrCookieSlime1
    instead of
    /tokenenchant add mrCookieSlime 1
     
Thread Status:
Not open for further replies.

Share This Page