Home v3 - RealMegaMinds/ActionInventoryMod GitHub Wiki

Also checkout:

Action Inventory Builders

Sgui uses GuiBuilders to create guis. Action inventories are special guis. Action inventories are created on demand by the builders that you provide. Action inventory builders are created using the json format. The json files are put in datapacks. See Data Packs v3.

Builders are loaded when a server starts and when the command /reload is used.

An action inventory builder looks like:

{
  "type": "",
  "name": "",
  "title": {},
  "includePlayer": false,
  "lockPlayerInventory": false,
  "elements": [],
  "openAction": {},
  "closeAction": {},
  "anyClickAction": {},
  "checkOpenAction": {},
  "recipeAction": {},
  "chained": false
}

Type (required)

This controls how the inventory is displayed. This is an identifier of a screen handler type. Vanilla Minecraft has:

Types
  • "generic_9x1"
  • "generic_9x2"
  • "generic_9x3"
  • "generic_9x4"
  • "generic_9x5"
  • "generic_9x6"
  • "generic_3x3"
  • "anvil"
  • "beacon"
  • "blast_furnace"
  • "brewing_stand"
  • "crafting"
  • "enchantment"
  • "furnace"
  • "grindstone"
  • "hopper"
  • "lectern"
  • "loom"
  • "merchant"
  • "shulker_box"
  • "smithing"
  • "smoker"
  • "cartography_table"
  • "stonecutter"

Name (required)

This is used to reference the builder from other places. This is an identifier. Names must be unique for each builder.

Title (defaults to no text)

This is the display at the top of the inventory. This is a text object.

Include Player (defaults to false)

Whether the player's inventory slots should be included in the gui. Including a player's slots allows for more elements, but the player won't be able to access any of their items while in the gui. This is a boolean.

Lock Player Inventory (defaults to false)

Whether the player is able to move things in their inventory. This is automatically set to true if includePlayer is true. This is a boolean.

Elements (defaults to no elements)

These are the elements of the inventory. These are what actually do stuff. This is an array of objects. See Elements v3.

Open Action (defaults to no action) Added: 3.1

This is an action that gets executed when (right before) an Action Inventory is opened. See Actions v3.

Close Action (defaults to no action) Added: 3.1

This is an action that gets executed when (right after) an Action Inventory is closed. See Actions v3.

Any Click Action (defaults to no action) Added: 3.1

This is an action that gets executed whenever a slot in an Action Inventory is clicked. See Actions v3.
(For actions that only occur for one slot, you should set the action for the element in that slot instead)

Recipe Action (defaults to no action) Added: 3.1

This is an action that gets executed when a recipe in the recipe book is clicked. See Actions v3.

Check Open Action (defaults to allowed) Added: 3.7.0

This is a requirement action that tests if a player can open the inventory. See RequirementAction v3. The fields from Actions v3 are not needed and have no effect.

Chained (defaults to false) Added: 3.2

Whether the previous ActionInventory should be opened when this inventory is closed. This only matters if this inventory was opened by another ActionInventory. This is a boolean.

⚠️ **GitHub.com Fallback** ⚠️