Jump to content

How to detect GUI (inventory) opening?


walknthedark

Recommended Posts

Hi, I've been trying for some time to write code that detects the moment I open the GUI to a player, but I can't manage it.

After a long search, I came across a class called "GuiScreen", but I can't use it - it just doesn't exist.

In general, I would like to know how to OPEN a GUI in the form of a chest (player's inventory). This would help me in further work. Thanks in advance.

Edited by walknthedark
Link to comment
Share on other sites

Look at how ChestBlock.use() uses getMenuProvider()

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

On 7/16/2022 at 6:30 PM, Luis_ST said:

are you talking about a client side Screen or a server side Menu?

The server I play on periodically displays a chest in which you have to choose the right item (a kind of Anti-AFK).

I need to detect if he has opened the chest for me, and then select the item based on the name of the chest.

Link to comment
Share on other sites

  • walknthedark changed the title to How to detect GUI (inventory) opening?
  • Guest locked this topic
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.