Skip to content

Actions

Actions are a list of things that are executed when an item is clicked.


Actions follow the below format, which is a MAP of actions that will be run. Each entry needs its unique string identifier. In this example below. It has two actions defined within the "actions": {} section: action_1 and action_2.

"actions": {
"action_1": {
// Action options...
},
"action_2": {
// Action options...
}
}

The type of action that this entry is. A list of types can be found in Action Types.

"type": "MESSAGE"

Additional options are available depending on the type of action used. See Action Types for each type’s additional options.


These are the available Action Types along with a short description and the required mods, if any.

IdentifierDescriptionRequired Mods
MESSAGESend a message to the player
COMMAND_CONSOLERun a command as the console
COMMAND_PLAYERRun a command as the player
BROADCASTBroadcast a message to all players
PLAY_SOUNDPlay a sound to the player
OPEN_SHOPOpens the shop specified for the player
CLOSE_SHOPClose the open Shop for the player
NEXT_PAGEMove to the next page of the Shop
PREVIOUS_PAGEMove to the previous page of the Shop
LAST_PAGEMove to the last page of the Shop
FIRST_PAGEMove to the first page of the Shop
BACKMove to the previously open shop

Sends a message to the player, parsed by Placeholder Services. Uses MiniMessage formatting!

"type": "MESSAGE",
"message": ["<blue>This is a message to the player!"]

Runs a command as the console, parsed by Placeholder Services.

"type": "COMMAND_CONSOLE",
"commands": ["give %player% diamond 1"]

Runs a command as the player, parsed by Placeholder Services.

"type": "COMMAND_PLAYER",
"commands": ["say Hello, I am %player%!"],
"permission_level": 1 // Optional. Permission level the command is ran as

Broadcasts a message to all players, parsed by Placeholder Services. Uses MiniMessage formatting!

"type": "BROADCAST",
"message": ["<green>%player% has clicked the special item!"]

Plays a sound to the player. The sound is sent as a packet, so other players will not hear it.

"type": "PLAY_SOUND",
"sound": "minecraft:entity.player.levelup",
"source": "MASTER", // Optional, defaults to MASTER. Valid sources: MASTER, MUSIC, RECORD, WEATHER, BLOCKS, HOSTILE, NEUTRAL, PLAYERS, AMBIENT, VOICE
"volume": 1.0, // Optional, defaults to 1.0
"pitch": 1.0 // Optional, defaults to 1.0

Opens the specified Shop menu for the player.

"type": "CLOSE_SHOP",
"id": "example_shop"

Closes the current Shop menu for the player.

"type": "CLOSE_SHOP"

Moves to the next page of the current Shop menu.

"type": "NEXT_PAGE"

Moves to the previous page of the current Shop menu.

"type": "PREVIOUS_PAGE"

Moves to the last page of the current Shop menu.

"type": "LAST_PAGE"

Moves to the First page of the current Shop menu.

"type": "FIRST_PAGE"

Opens the Shop menu that was open prior to this menu. Only works in the context of a OPEN_SHOP action or in a Confirmation Menu.

"type": "BACK"