Openers v2 - RealMegaMinds/ActionInventoryMod GitHub Wiki

Openers


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:

Type

key = 'type'
Can be one of 'name', 'tag', 'nbt', 'pos', 'identifier', 'uuid', and 'team'.

ClickType

key = 'clickType'
Can be one of 'attack' or 'use'.

What

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.

Type Specific

Depending on the type, there are additional requirements.

Name

supported whats: 'entity', 'itemstack', and 'block'
An opener with type 'name' must have:

Name

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.

Only Checks 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).

Use Custom

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.

Tag

supported whats: 'entity', and 'block'
An opener with type 'tag' needs:

Tag

key = 'tag'
This is a string. This is the identifier of the tag to check.

NBT

supported whats: 'blockentity', 'itemstack', and 'entity'
An opener with type 'nbt' must have:

Key

key = 'key'
This is a string. This is the name of the nbt key to look for.

Value

key = 'value'
This is a string. It is in snbt format. This is the value to check.

Only Check Presence

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).

Pos

supported whats: 'blockentity', and 'entity'
An opener with type 'pos' must have:

Pos

key = 'pos'
This is an array. Should contain three ints which are the x, y, and z components of the position.

Identifier

supported whats: 'block', 'blockentity', 'entity', and 'itemstack'
An opener with type 'identifier' must have:

ID

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.

UUID

supported whats: 'entity'
An opener of type 'uuid' must have:

UUID

key = 'uuid'
This is a string. This is the UUID to check.

Team

supported whats: 'entity'
An opener of type 'team' must have:

Team Name

key = 'teamName'
This a string. This is the name of the team to check.

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