I wanted to make a mod that locks an item in the player's inventory or hotbar. The mod will lock that item to prevent the player from dropping it by accident. And to drop that item, the player should press and hold the drop button.
I spent a few hours trying to figure out how to do this, but I couldn't, so I searched and found this mod https://modrinth.com/mod/dont-drop-it, which does what I want (almost). So, is someone able to explain to me how it works? The mod is open source, I need its functionality on 1.21.8 (And I wanted to somehow make it work on servers)
I would appreciate any help regarding this,
Thanks, I wish y'all a supercalifragilisticexpialodocious day and May God Bless you (: