You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made a GUI with LibGui which has 2 Item Slots(1 Input, 2 Output). It halso has a button and when i click it it should remove the input item and add a Item to the Output Slot but its doesnt really do it. It shows that the Input Item is not in the slot anymore and it also shows The Output Item correctly until i click somewhere in the inventory . Then it resets the inventory so that the output item disappears and the input item again in the input slot.
You can't really modify inventory contents from the logical client (this includes setStack), as the logical server fully controls and manages inventories.
Instead, you need to send a packet or a LibGui screen message from the client (button.setOnClick(() -> { /* from here */ })) to the server telling it that the button has been pressed. The server can then modify the block inventory.
Also: avoid doing file IO like deleteIfExists directly on the render thread in button click listeners etc, it can freeze the screen which is frustrating for players.
I have made a GUI with LibGui which has 2 Item Slots(1 Input, 2 Output). It halso has a button and when i click it it should remove the input item and add a Item to the Output Slot but its doesnt really do it. It shows that the Input Item is not in the slot anymore and it also shows The Output Item correctly until i click somewhere in the inventory . Then it resets the inventory so that the output item disappears and the input item again in the input slot.
Hope someone can help me with that :)
Code(GuiDesc): https://pastebin.com/Z1ZQKQZK
Video:
Uploading 2024-11-14 21-38-45.mp4…
The text was updated successfully, but these errors were encountered: