Replies: 3 comments 2 replies
-
I'm assuming you are using Paper. You seem to be making it more complex than needed. @EventHandler
public void onEvent(ChatEvent event) {
final TranslatableComponent component = Component.translatable(new ItemStack(Material.ANCIENT_DEBRIS));
final Component mini = MiniMessage.miniMessage().deserialize("<translatable>", Placeholder.component("translatable", component));
event.getPlayer().sendMessage(mini);
} This seems to do what you want, and works fine for me. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your message. I just figured out that it is also important, to use the correct "sendMessage()" method from Kyori (not Bukkit). |
Beta Was this translation helpful? Give feedback.
-
I do have another question. I dont have an idea where/how to inculde that. Do i need to make another Placeholder? Or is it some kind of component? |
Beta Was this translation helpful? Give feedback.
-
Hello,
i need some help with translatables and dynamic replacements. I have gone through the docs multiple times but i can't get it to work.
The "best" version i have is:
The output this gives me is:
item.minecraft.ancient_debris
.I have tried dozens of variants but i can't get it to work. What am i doing wrong? Please help me out with that :)
Beta Was this translation helpful? Give feedback.
All reactions