Solved Obtain item name from ID

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
G

Goetheus

Hi everybody!

I know how to obtain an ID from an item or item type, but how can I get the name of an item from its ID?

stone => 1 => set {_id} to ids of item
1 => stone => ?

Thank you very much! :emoji_slight_smile:

EDIT:
{_item} is 1
I found "set {_itemname} to ("%{_item}%" parsed as item)"
{_itemname} returns "stone"

But, if {_item} is 35, it returns "white_wool_block" and not "wool"...
For 5, I get "normal wood plank" and not "plank" :/
 
Last edited by a moderator:
That's how their referenced in your aliases. The only way to fix this is manually change aliases to whatever you want
 
That's because the default wool is the white one and the normal wood plank(oak) is the default too.
You can use replace to remove "_" and put spaces.
 
You can use replace to remove "_" and put spaces.
Yes, I know this, but still a workaround :'(
Everyday I create workarounds for skript/minecraft, please, re-writte this game in C++ with real devs ah ah x)

For the moment, I use a YML file with equivalency like this : white_wool_block: wool
And my script check the name and recovers it for use.
 
Last edited by a moderator:
Status
Not open for further replies.