Currently, there is no way to get the translated name of an item via the scripting api. This makes it difficult to include items in scripted messages and other scripting gui elements. I propose that the minecraft:display_name component be retrievable via script.
So you could do:
let item = new ItemStack("wiki:custom_item");
let translation = item.getComponent("minecraft:display_name").value;
Ideally, this would work not only on custom items, but also vanilla items, as well as vanilla and custom blocks. This would make using them in server messages easier.
Please sign in to leave a comment.
0 Comments