Openers v2 - RealMegaMinds/ActionInventoryMod GitHub Wiki
Openers are what allow you to actually open up action inventories. There are five things that can trigger an opener: use item, use/attack block, and use/attack entity.
Openers are represented by a json object. All openers have:
key = 'type'
Can be one of 'name', 'tag', 'nbt', 'pos', 'identifier', 'uuid', and 'team'.
key = 'clickType'
Can be one of 'attack' or 'use'.
key = 'what'
Can be one of 'block', 'blockentity', 'itemstack', or 'entity'. (Not all types support all whats)
'block' and 'blockentity' are used when a block is attacked or used. 'itemstack' is used when an item is used. 'entity' is used when an entity is attacked or used.
Depending on the type, there are additional requirements.
supported whats: 'entity', 'itemstack', and 'block'
An opener with type 'name' must have:
key = 'name'
This is an object. This is the name that the item/entity/block must have to open. Visit here for help creating text.key = 'onlyChecksText'
This is a boolean. This determines whether only the actual string values should be checked (true) or if the styles should also be checked (false).key = 'useCustom'
This is a boolean. This determines if the custom name is checked (true) or is the default/non-custom name is checked (false). Doesn't work with blocks.
supported whats: 'entity', and 'block'
An opener with type 'tag' needs:
key = 'tag'
This is a string. This is the identifier of the tag to check.
supported whats: 'blockentity', 'itemstack', and 'entity'
An opener with type 'nbt' must have:
key = 'key'
This is a string. This is the name of the nbt key to look for.key = 'value'
This is a string. It is in snbt format. This is the value to check.key = 'onlyCheckPresence'
This is a boolean. This determines whether the presence of a key is enough (true) or if the value should also be matched (false).
supported whats: 'blockentity', and 'entity'
An opener with type 'pos' must have:
key = 'pos'
This is an array. Should contain three ints which are the x, y, and z components of the position.
supported whats: 'block', 'blockentity', 'entity', and 'itemstack'
An opener with type 'identifier' must have:
key = 'id'
This is a string. This is the identifier to check. For block entities and entities this is the identifier of their type. For an item stack this is the identifier of its item.
supported whats: 'entity'
An opener of type 'uuid' must have:
key = 'uuid'
This is a string. This is the UUID to check.
supported whats: 'entity'
An opener of type 'team' must have:
key = 'teamName'
This a string. This is the name of the team to check.