#Can someone explain for me how this mod works?

7 messages · Page 1 of 1 (latest)

floral tiger
#

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 (:

#

P.S. and TL;DR: I am trying to find a way to cancel item dropping, and at the same time, it should be client-sided and work on servers.

midnight panther
#

Im working on this exact thing for one of the modules in my client. I’ve almost got it working so you can hold a keybind and click a slot to lock it, but I haven’t figured out how to stop the drop keybind. I’ll take a look at the mod tmr

teal flint
#

To make the item not drop when pressing the keybind I’m taking a wild guess you’d mixin into wherever the keybind / interaction is (likely PlayerEntity) then cancel it

#

I’m taking a guess though

#

Well then again the most straightforward answer is often not the correct one so

midnight panther