Started by
T-cat2.0
on
Topic category: Advanced modding
is there a way to get the item id from an item in a slot e.g. I put cobblestone in slot 0 and i make it print that to chat: it prints 1xminecraft:stone 2.
I need it to print minecraft:stone:2 not 1xminecraft:stone 2, is this posable?
yes just remove each letter until the letter is x and then remove x
If you can use custom code at all you can use this to get the namespace and then do whatever you want with the string. I couldn't figure out how to get the namespace of an item anymore I looked everywhere in minecraft's code that I could think of but I could only find getDesciptionId() which is different. There used to be plugins that did it but that code didn't work anymore. This will get the namespace of a block or item though.
Rename item to whatever the itemstack your using is.
If anyone else has a better way to get the namespace in code than converting the desciption id please lmk.