tellraw message in yaml

Discussion in 'Bukkit Help' started by BooGaLoo90, Dec 12, 2017.

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

    BooGaLoo90

    Hello!
    I am trying to run /tellraw command inside of a .yml

    my ultimate goal is simply to get tell raw to say "{Username} has just been promoted!" in aqua. i tried using tellraw generate online but to no avail. please help!
    Code:
        commands:
          - pex promomte {username} main
          - pex user {username} group add dirt
          - tellraw @a ["",{"text":"{username} has just been promoted!","color":"aqua"}]
     
  2. Offline

    Zombie_Striker

    @BooGaLoo90
    What are you using to run the command? Are you sure you are issuing the command correctly? Can we see your code?
     
  3. Offline

    BooGaLoo90

    the "code" box above is the config.yml
    the plugin, upon a specific event, will run the list of commands defined in this config.yml
    i want a global message saying "{username} has been promoted!"

    the code is irrelevant really, im asking for help on how to use the /tellraw command as if i ran it through a console.

    I made a little progress since i made this post, i tried 2 ways:
    tellraw @a {"extra":[{"selector":"@p"}],"text":" Has Been Promoted!"}
    tellraw @a {"text":" Has Been Promoted!","extra":[{"selector":"@p"}]}

    however, both ways make the same output: " Has Been Promoted!BooGaLoo90"
     
  4. Offline

    Drkmaster83

    Might not be irrelevant, if you have the username being replaced in the pex commands but not in this, then it's definitely the code. My question would be how does the player get promoted through pex if the TellRaw doesn't work?
     
  5. Why would you use this? Just make a custom command to promote someone. Or even use the Pex Library to make it easier to code. Plus you could learn configs to add custom messages like "{USERNAME} promoted to {RANK}" then manipulate the string to replace those with what you want.

    Oh, and your code is relevant because you could be iterating through the array of commands wrong, your onCommand method could be wrong, so when someone asks for your code, just post it. No big deal if you actually want your problem solved.

    One obvious thing is you spelled "promote" wrong .-.

    One simple solution is inside your code just make a Bukkit.broadcastMessage or whatever the method is called, then ChatColor.translateAlternateColor codes so set the message inside your "commands" array then send out the global message as a separate thing.
     
    Last edited: Dec 12, 2017
  6. Offline

    BooGaLoo90

    Once again, the code is irrelevant, i can assure you. you would have just wasted your time with reading code.

    I used an online tellraw generator to help me. didnt realize they had those until a few google searches.

    Code:
    tellraw @p ["",{"text":"+++++ ","color":"aqua"},{"selector":"@p","color":"aqua"},{"text":" Has Been Promoted! +++++","color":"aqua"}]
    produces:
    ++++ {Username} Has Been Promoted! ++++
     
  7. @BooGaLoo90 Look, no one asked for your opinion on if the code is irrelevant or not. Just post the code.

    Also, I gave you at least two valid suggestions that you can try, so.
     
  8. Offline

    BooGaLoo90

    look, you dont need to start flaming me simply because you dont know how to use the /tellraw command.
     
  9. It’s not flaming you, but now I will.

    Just because you’re too ignorant to listen to some valid suggestions that would get your program to work doesn’t mean “I don’t know how to use the /tellraw” command. You picked the most inefficient way to do your program which is why it’s giving you so much trouble. Bukkit literally had a broadcast message method. And I don’t know if you’re noticed, but around here we post code if it doesn’t work most of the time.

    Have fun with your broken plugin.
     
  10. Offline

    BooGaLoo90

    thanks, but as i said in my OP, its not a program or plugin, its a .yml. so you asking for code, and making code suggestions is really INAPPLICABLE.. in the end, its not my plugin and i cannot edit the code. while it is a pain to use sometimes, it offers unlimited capabilities and i dont have to download 20 different plugins like other servers. ya id agree with you that tellraw is a PAIN thats why i am here asking plugin developers help with json.

    i didnt realize i needed to write an essay to you before i can ask a simple question on how to use tellraw. but because of your opinion and attitude, it seems as though i cant ask a simple questions without you flaming me.

    in the end, you wasted both our times simply because you couldnt just help me with tellraw.

    in the end, its really me not asking for your opinion. not the other way around. i asked help with tellraw, not help with a program.
     
  11. Offline

    timtower Administrator Administrator Moderator

    Moved to Bukkit help
    @BooGaLoo90 You didn't tell that it wasn't your plugin, and due to the fact that this was in plugin development we thought that it was your code.
     
    OfficerDeveloper likes this.
  12. Offline

    BooGaLoo90

    still doesnt change why no one could simply help me with tellraw. the reason i posted in plugin development is because unlike all other commands, tellraw requires coding knowledge and language. therefore, it seemed the best place to post for help, directly in a section where you ask for help with code.
     
  13. Offline

    timtower Administrator Administrator Moderator

    Isn't code though.
    http://www.minecraftforum.net/forum...t-component-for-tellraw-title-books#translate
     
Thread Status:
Not open for further replies.

Share This Page