Skip to content

Actions

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


When defining actions, you must know where you want to use them. Is it a action when clicking on an item? Is it a action when opening a GUI? Depending on where you want to use the actions, the name used is different.

Generally, actions follow the below format. A MAP of actions that may be ran. 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. To understand what use cases are available, see Example Uses.

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

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

"type": "MESSAGE"

The type of click that is required for this action to execute. Must be in full capitalization. A list of types can be found in Click Types. Defaults to ANY if not provided.

"click": "ANY"

The time in ticks (20 ticks a second) until the action should be executed. Defaults to 0 (no delay) if not provided.

"delay": 100

The chance that this action should be executed. Allowed values are between 0.0 and 1.0. An example of a 50% chance would be 0.5. Defaults to no chance check if not provided.

"chance": 0.5

Define when an action is allowed to execute using conditionals. All listed requirements must be met in order for the action to be ran. The Click Type must be correct before the requirement will be checked. 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 and their respective settings. Some settings are optional, while others may be required.

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
PLAYSOUNDPlay a sound to the player
OPEN_GUIOpen a GUI for the player
CLOSE_GUIClose this GUI for the player
REFRESH_GUIRefresh the player’s current GUI
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": "PLAYSOUND",
"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 a SkiesGUI menu for the player.

"type": "OPEN_GUI",
"id": "example_gui"

Closes the current SkiesGUI menu for the player.

"type": "CLOSE_GUI"

Refreshes the current SkiesGUI menu for the player.

"type": "REFRESH_GUI"

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 is a list of valid click types that can be used in the click_type option for Actions.

IdentifierLeft ClickShift Left ClickRight ClickShift Right ClickMiddle ClickThrow (Q)
ANY
LEFT_CLICK
SHIFT_LEFT_CLICK
ANY_LEFT_CLICK
RIGHT_CLICK
SHIFT_RIGHT_CLICK
ANY_RIGHT_CLICK
ANY_CLICK
ANY_MAIN_CLICK
ANY_SHIFT_CLICK
MIDDLE_CLICK
THROW

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 GUI is opened.

{
"open_actions": {
// List of actions...
}
}

Actions that are executed when the GUI is closed.

{
"close_actions": {
// List of actions...
}
}

Actions that are executed when the GUI is closed.

{
"items": {
"example_item": {
"item": "minecraft:diamond",
"click_actions": {
"action_1": {
// Action options...
}
}
}
}
}

Actions that are executed when a requirement section is successful.

"<type_>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...
}
}
"actions": {
"action_1": {
"type": "COMMAND_CONSOLE",
"click": "ANY",
"commands": ["give %player% diamond_sword 1"]
},
"action_2": {
"type": "MESSAGE",
"click": "ANY",
"message": ["<blue>You have received the Example Sword!"]
},
"action_3": {
"type": "COMMAND_CONSOLE",
"click": "ANY",
"commands": ["give %player% diamond 1"],
"requirements": {
"requirements": {
"type": "PERMISSION",
"permission": "test.permission"
}
}
},
"chance_action_1": {
"type": "MESSAGE",
"click": "ANY",
"chance": 0.5,
"message": ["<gold>This is a RARE message!"]
},
"delayed_action_1": {
"type": "MESSAGE",
"click": "ANY",
"delay": 100,
"message": ["<blue>You received the Example Sword 5 seconds ago!"]
}
}