Started by
Fresfries
on
Topic category: Help with Minecraft modding (Java Edition)
I'm stuck with this problem on trying people not to be able to toss the item that opens a container, lets say a backpack, out of the main hand, without the gui closing.
I tried a workaround by checking if the item is in the inventory, but not in the main hand & if so, close the gui. But rather than closing it crashes and you have to kill yourself
because otherwise the gui isn't fully closed.
This is what I've tried, which clearly doesn't work:
The best solution would be to make the slot of the backpack, if the gui is opened, not interactable but I don't know how.
on your slot make it not be able to insert hoppers
Sorry, either I don't get what you're saying, or I explained my issue wrong.
So if the hopper opens this gui, how do I make it so you cant move the hopper around, no matter where in the inventory/gui, as long as this gui is opened?
Or make it so, if the gui is opened by right clicking the hopper, if you move the hopper the gui closes, that would also work.
but right now it only closes if I throw the hopper out of the inventory.
gui open tick
if not event target entity has HOPPER in main inventory
do close gui for event target entity
Thanks, that worked perfectly