Started by
SparkleArts
on
Topic category: Help with Minecraft modding (Java Edition)
I want to create a Command that adds Lore to Items, but I can't find it to work because I have problems to detect the slot number/id of the Item that in Main Hand.
Can someone help with this?
Here is how I detected the slot ID of the item in your main Hand.
https://imgur.com/5ufv8C2
I created a temporary item to replace with the the item in your main hand. Then I searched the inventory (slots 0 - 9) for said temporary item. When it finds that item, it exits the loop at give you the slot ID number of the item in your main Hand (variable: num).
You can return the item to your main Hand if needed, as the item info was stored in the inHand variable.