Closed taliform closed 2 years ago
Brigadier's string - Each string argument type can accept either a single word (no spaces), a quotable phrase (either single word or quoted string), or a greedy phrase (taking the rest of the command as the string argument).
So you can do /tr @a Satan red Welcome to hell!
You only quote /tr @a "If Satan's name has a space or more" red Welcome to hell!
which will results in
Which is intended behavior from Brigadier. Perhaps I could add a functionality to remove quotes like @removeQuotes
. I don't plan on updating COMMAND_ALIAS
in the future, if you can you should move over to COMMAND_CUSTOM
Sorry, the quotations were happening yes when the name is in quotations to include spaces. I'm using it to make my NPCs talk, so the names are like "Guard A", "Guard B".
I have added a temporary branch with the @removeDoubleQuotes
, you can fetch them from here. This will make it into the next official release but there is a format change.
Thanks! Will try it out. Can you combine 2 or more formatters?
Like {message@jsonString@removeDoubleQuotes}
?
No(exact reason I'm abandoning COMMAND_ALIAS
for COMMAND_CUSTOM
), I assume you just want to remove it from the name not the message.
{
"commandMode":"COMMAND_ALIAS",
"command":"tr {arg::minecraft:game_profile#Target} {arg::brigadier:string#FromName} {arg::minecraft:color#NameColor} {arg::minecraft:greedy_string#Message}",
"execution":[
{
"command":"tellraw {Target} [\"\",{\"text\":\"{FromName@removeDoubleQuotes}\",\"color\":\"{NameColor}\"},\": {Message@jsonString}\"]",
"type":"CLIENT"
}
]
}
Just tested it out, @removeDoubleQuotes
is working wonders. Finally was able to reduce the length of my tellraws. :) Thanks! Will wait for the next official release.
See title.
I'm writing a COMMAND_ALIAS for my tellraws. The goal is to have it formatted like so: Name of Sender: Message
It works, but the "Name of Sender" includes the quotation marks when I use @jsonString, so it outputs like this: "Name of Sender": Message
My command is as follows:
So I do it like: /tr @a "Satan" red Welcome to hell!
and it outputs: "Satan": Welcome to hell!
But I want it as: Satan: Welcome to hell!