mojira.dev
MC-10880

Comma or other symbol after @ selector does not work with command blocks

@p and @a won't list usernames

What I expected to happen was...:

Command Block: /say @p, You are not allowed to access this area!

What actually happened was...:
[@] @p, you are not allowed to access this area!

Steps to Reproduce:
1. Get a command block (/give username 137)
2. Type in the command block /say @p, somat here
3. Power with redstone

Result:

[@] @p, somat here

Linked issues

Attachments

Comments 23

kumasasa

Cannot reproduce.
@p is replaced by player name

Tails

Please do not mark issues as private, unless your bug report is a security issue containing information that may compromise your server/client.

Jens Bergensten

@p is case sensitive, maybe that's the problem?

The.Modificator

I think the problem is caused by the comma after @p. I did a similar thing with an exclamation mark like this:

say Well done, @p!

This will output: "Well done, @p!"

It only worked when I added a space after @p like this:

say Well done, @p !

This will output: "Well done, The.Modificator !"

EDIT: Just tested it with the comma. Same behavior here.

The.Modificator

IMO a good resolution for this would be allowing this syntax:

say Well done, @p[]!

Using such a character sequence pretty much ensures that those characters should be interpreted as a placeholder, not part of a normal chat line.

Just doing a normal search-and-replace for just "@p" won't work as it breaks "normal" chat lines like this:

say @carl_d: Please bring some food. @peter_h: Please bring the arrows!

This would then output: "@carl_d: Please bring some food. The.Modificatoreter_h: Please bring the arrows!" The character sequence "@p[]" shouldn't appear in normal chat though. (Except for very fancy smileys.)

13 more comments
The.Modificator

Well, yeah: /say @p is there. Hello, @p! @p, What's up? will still result in the chat line The.Modificator is there. Hello, @p! @p, what's up?, so the behavior is not changed.

However, since the command /tellraw was introduced a few versions ago, there is a wordaround for this now.

galaxy_2alex

Reopened, thanks,

The.Modificator

I'd like to add that /say Test, @p[]! does also not work (as discussed above). However, I'd still vote to close this ticket because whenever someone wants to accomplish something like this, he/she can easily use /tellraw now. So there is no need for changing the current behavior.

Nathan Adams

This may be fixed later when we use my Brigadier command library, but no promises so I'm going to leave it open until it actually is fixed 🙂

Bradley Paul Gizzi

Updated this, been 2 years nearly since it was reported, minor issue but would be nice to have fixed.

Bradley Paul Gizzi

(Unassigned)

Confirmed

selector

Snapshot 13w09a, Snapshot 13w09b, Snapshot 13w09c, Snapshot 13w10a, Minecraft 1.5, ..., Minecraft 1.10.2, Minecraft 16w35a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.12.2

Minecraft 17w46a

Retrieved