Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translating a component inside a TranslatableComponent as an argument #1157

Open
MerryDev opened this issue Jan 22, 2025 · 0 comments
Open

Comments

@MerryDev
Copy link

Using this registry implementation and this properties file

team.red = <red>Team Red
mapsetup.stage.9.name.success = <grey>The spawnpoint of <arg:0> <grey>has <green>successfully<grey>been set.

Returns <grey>The spawnpoint of team.red <grey>has <green>successfully<grey>been set.

The code that sends the component to the player is

TranslatableComponent translatableComponent = Component.translatable("team.red");
Component component = Component.translatable("mapsetup.stage.9.name.success", translatableComponent);
player.sendMessage(component);

What I expect to get as an output is <grey>The spawnpoint of <red>Team Red <grey>has <green>successfully<grey>been set.

After debugging my code I realized that the argument is not treated as a TranslatableComponent although internally a implementation of it is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant