Adding items to player inventory when a GUI is closed

Started by HogNutsJava on

Topic category: Help with modding (Java Edition)

Last seen on 03:33, 17. May 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Adding items to player inventory when a GUI is closed

I am making a mod that adds a custom crafting table into the game. Everything else works amazingly, but I am having trouble with the procedure that plays when the GUI is closed. 

I want the procedure to be identical to the vanilla crafting table, spawning the items left in the input slots directly into the inventory of the player that interacted with the GUI.

This mod is intended for use in a server context, so it is important that it targets the player who interacted with the GUI and not the nearest player, and also that it does not just drop the items on the ground, they need to go directly into the players inventory, how would I do this.

Last seen on 03:33, 17. May 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm i had block entity…
Fri, 05/17/2024 - 03:34

nvm i had block entity enabled when i shouldn't have, the tutorial i followed for the basic crafting gui said to enable it but it should have been disabled.