This Mod was created for Parcels ME5 pack and creates command to close a gui or to detect if certain types of guis are open.
These are also throwable by QuestBooks and Command Blocks.
Commands:
This would allow you to make areas where people can't open their inventories, or ensure that the main game screen is present so the player is not missing something.