Skip to content

Actions

Actions are a list of things that are executed when an item is clicked or a Requirement has failed/succeeded, depending on where they are defined.


Generally, actions follow the below format. A list of actions that may be ran. In this example below. It has two actions defined within the "actions": {} section. To understand what use cases are available, see Example Uses.

"actions": [
{
// Action 1 options...
},
{
// Action 2 options...
}
]

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

"type": "MESSAGE"

Define when an action is allowed to execute using conditionals. All listed requirements must be met in order for the action to be ran. Optionally, Actions can be defined to execute when the requirements have failed or succeeded. See Requirements for more information on requirements.

"requirements": {
"requirements": [],
"deny_actions": [],
"success_actions": []
},

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
GIVE_XPGive XP to the player
CURRENCY_DEPOSITDeposit currency from a player’s account
CURRENCY_WITHDRAWWithdraw currency from a player’s account
CURRENCY_SETSet the balance of a player’s account
GIVE_ITEMGive the player an item
TAKE_ITEMTake an item from the player if possible. Strict will define if NBT needs to be exact
MOLANGExecutes a set of molang scripts/expressionsCobblemon

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

Gives XP to the player.

"type": "GIVE_XP",
"amount": 10,
"level": false // Optional, defaults to false. True to give levels, false to give points

Deposits currency into the player’s account.

"type": "CURRENCY_DEPOSIT",
"economy": "IMPACTOR",
"currency": "impactor:dollars", // Optional
"amount": 100

Withdraws currency from the player’s account.

"type": "CURRENCY_WITHDRAW",
"economy": "IMPACTOR",
"currency": "impactor:dollars", // Optional
"amount": 100

Sets the balance of the player’s account.

"type": "CURRENCY_SET",
"economy": "IMPACTOR",
"currency": "impactor:dollars", // Optional
"amount": 1000

Gives an item to the player.

"type": "GIVE_ITEM",
"item": "minecraft:diamond_sword",
"amount": 5, // Optional
"components": {}, // Optional
"custom_model_data": 1, // Optional
"strict": true // Optional, defaults to true

Takes an item from the player if possible.

"type": "TAKE_ITEM",
"item": "minecraft:diamond_sword",
"amount": 3, // Optional
"components": {}, // Optional
"custom_model_data": 1, // Optional
"strict": false // Optional, defaults to true

Executes a set of Molang scripts/expressions for Cobblemon. Requires the Cobblemon mod

"type": "MOLANG",
"script": ["q.gui.player.tell('test');"]

Below are examples of how to use actions in different sections of a GUI configuration. This list is not exhaustive, but covers the most common uses.

Actions that are executed when the item is clicked.

{
"items": {
"example_item": {
"display": {},
"actions": [
{
// Action options...
}
]
}
}
}

Actions that are executed when a requirement section is successful.

"requirements": {
"requirements": [],
"success_actions": [
// List of actions...
]
}

Actions that are executed when a requirement section is failed.

"<type_>requirements": {
"requirements": [],
"deny_actions": [
// List of actions...
]
}