mojira.dev
MC-113963

Score text components do not work with entity UUIDs and do not print same selector errors like other commands

The bug

Score text components do not work with entity UUIDs and do not print the same error messages if multiple entities match a selector.

How to reproduce

Different error message

See also MC-113962

  1. Use the following command containing a score component

    /tellraw @p {"score":{"objective":"","name":"@e"}}

    → It prints "Selector '@e' found nothing"

  2. Use a different command which allows only one entity

    /tp @p @e

    → It prints "Entity '@e' cannot be found"

Entity UUID not working

  1. Use the following command to create an scoreboard objective

    /scoreboard objectives add test dummy
  2. Summon an entity with a defined UUID

    /summon armor_stand ~ ~ ~ {UUID:[I;0,0,0,0]}
  3. Set a score for the entity; you can use the UUID to identify the entity if you want to

    /scoreboard players set 0-0-0-0-0 test 1
  4. Use a command with a score component

    /tellraw @p {"score":{"objective":"test","name":"0-0-0-0-0"}}

    → It does not print the score

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.util.text.TextComponentUtils.processComponent(ICommandSender, ITextComponent, Entity) does not use the method net.minecraft.command.CommandBase.getEntity(MinecraftServer, ICommandSender, String), instead it partwise implements the behavior of this method itself.

Linked issues

Comments 3

Can confirm the second part of the bug (UUIDs not working) for 1.16.1.

The command /tp @p @e now gives the error message "Incorrect argument for command at position 7: /tp @s <--[HERE]".
The command /tellraw @p {"score":{"objective":"","name":"@e"}} gives the error message "Only one entity is allowed, but the provided selector allows more than one".
I think the issue should be updated.

The summon command is outdated,

{UUIDLeast:0L,UUIDMost:0L}

should be changed to

{UUID:[I;0,0,0,0]}

First part is fixed now (both have "only one entity is allowed, but the provided selector allows more than one" message)
Second part I think we're using MC-129608 for

marcono1234

(Unassigned)

Confirmed

(Unassigned)

JSON, UUID, command, entity, score, scoreboard, selector, tellraw, text, title

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 18w03b

Retrieved