PaperMC / PaperMC/Paper

Selectors don't work in Text Display modifications

Open
#12,796 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When running

data merge entity @n[type=text_display,tag=gameDisplay,tag=gameDisplayT1S] {text:{"color":"black","score":{"name":"@n[type=armor_stand,tag=stateMarker]","objective":"BL_score_1"}}}

The text on the text display should change to match the score of the armor stand on scoreboard objective BL_score_1
(This is what happens in a vanilla singleplayer world)

Observed/Actual behavior

When running

data merge entity @n[type=text_display,tag=gameDisplay,tag=gameDisplayT1S] {text:{"color":"black","score":{"name":"@n[type=armor_stand,tag=stateMarker]","objective":"BL_score_1"}}}

The text on the text display does not change at all

Steps/models to reproduce

(though, the tags and entities besides the text display itself do not matter, it happens anyways no matter which entities score it pulls from)

Create a text_display with tags; gameDisplay and gameDisplayT1S
Create an armor_stand with tags: stateMarker
Create scoreboard objective with dummy criteria: BL_score_1

Set the armorstand to any score on BL_score_1

Run data merge entity @n[type=text_display,tag=gameDisplay,tag=gameDisplayT1S] {text:{"color":"black","score":{"name":"@n[type=armor_stand,tag=stateMarker]","objective":"BL_score_1"}}}

Nothing will happen, despite chat certifying the command went through

Plugin and Datapack List

Image

Paper version

Image

Other

I have already investigated removing all tags from the command, and the issue persists. Also did other checking to make sure the function itself was running, etc, etc.

This issue also existed in 1.20.4 (Unsure on the exact version, because at the time I believed it to just be Minecraft) However, it only happened when using @s as the selector.

Now it happens for all selectors. On singleplayer, the issue does not exist.

The only way to set the text to a score currently on paper, is to directly reference the entity

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the documented data merge entity command on Paper and compare the same text-display score component in vanilla singleplayer. Trace the server-side handling of selector-based score text resolution; done means selectors update the text display to show the referenced scoreboard value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.