Started by
Coolmanz7
on
Topic category: Help with Minecraft modding (Java Edition)
I was wondering on how to detect which of the 9 hotbar slots the player is currently on. I want to make each hotbar slot have its own unique ability. I don't think there is a specific block for this in any of the procedures tabs.
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.
Thank you for helping me!