How to detect when player opens their inventory

Started by B0nesRC0ol on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined Nov 2023
Points:
143

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
How to detect when player opens their inventory

I'm making a mod which as one of it's aspects replaces the vanilla minecraft inventory. To do this this I plan to detect when the player opens their inventory/has their inventory open, close the open GUI for the player, and open the custom inventory GUI... However I don't have any idea how I would detect when the player has their inventory open, If anyone has an idea as to how I might go about this, it would be much appreciated!

Active 2 months ago
Joined Sep 2021
Points:
967

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
What you could do is make a…
Mon, 01/22/2024 - 16:44

What you could do is make a keybind for the E key, (which is the same for opening the inventory), and have a procedure that runs when you press the keybind.

 

For the procedure, make it so it closes the current gui, (being the inventory), and opens your custom gui 

Active 1 year ago
Joined Feb 2024
Points:
108

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
Hi B0nesRC0ol!I have the…
Mon, 02/12/2024 - 11:56

Hi B0nesRC0ol!
I have the same Problem. Maybe we could chat or talk on Discord?
My Discord is: james310708.
 

Active 1 year ago
Joined Feb 2024
Points:
108

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
BTW, a solution could be, to…
Mon, 02/12/2024 - 12:11

BTW, a solution could be, to make a procedure, that triggers when i press E. The procedure closes all GUI's for me and opens my custom GUI.