how to convert item localized in game name to itemstack?

Started by vlonabuser on

Topic category: Help with modding (Java Edition)

Last seen on 15:46, 28. Jan 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to convert item localized in game name to itemstack?

I'm making a shop gui, where you type item name in textfield and it displays its price via procedure that checks if text from textfield matches item displayable name and sets price as number variable and item as itemstack variable for player, but because mcreator broke this system by making every item displayable name pop up as <<####>> how my gui isnt working at all

Last seen on 21:55, 20. Feb 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...This sounds kind of…
Sat, 11/11/2023 - 16:08

...This sounds kind of complicated; keep in mind that localization keys are different than the item display name. The item display name is what the name of the item literally reads, whereas the localization key is whatever the current default name of the item is based on what the language is set to. 

...Either way, if you want to make an interface like this work, and want the mod to be translatable, I recommend making custom localization keys for each of the items you want to sell. This way you don't have to worry about custom named items, or the weird formatting rules that come into play when trying to refer to item names.