-
Notifications
You must be signed in to change notification settings - Fork 0
Home v3
同时看: Common Types v3 Openers v3 Examples v3 模组构建 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. 见 Data Packs v3.
构建者在启动及键入/actioninventory reload 时被使用.
样式:
{ "type": "", "name": "", "title": {}, "includePlayer": false, "lockPlayerInventory": false, "elements": [], "openAction": {}, "closeAction": {}, "anyClickAction": {}, "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 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 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 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.
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.