Skip to content

Actions

Menu author

Action is something that happens after specific event (for example item click or menu opening). The plugin has a lot of actions. Below is a full list of actions.

NameData typeDescription
openMenuStringOpen a menu with the specified name
openMenuCtxStringSame as openMenu but forwards context from activator of previous menu
closeMenuBoolean or NumberClose current menu. If there is number instead of boolean, menu will be closed after delay in specified ticks
refreshMenuBoolean or NumberUpdate all menu content except the title. If there is number instead of boolean, menu will be updated after delay in specified ticks
messageObject or StringSend message to player. There is ability to send simple text, JSON text, title, etc.
broadcastObject or StringSend message to all players on server. Format similar to message action
miniMessageString(Deprecated. MiniMessage now supported by default message actions) Send message with mini-message
playerChatStrings listSend a message on behalf of the player who opened the menu
printStringPrint message in console. Useful for debugging
commandObjectExecute a list of commands on behalf of a player or server
inputChatObjectRequest player for enter text in chat and save result in variable
teleportObjectTeleport player to location
itemAddObjects listAdd any items to player
itemRemoveObjects listRemove items from player’s inventory. Items will be compared by specified properties or could be just removed by slot number
itemClearObjects listRemove items from player’s inventory the same way as itemRemove, but independent of itemstack size. The count property has no effect here
inventoryClearBooleanFully clear player’s inventory
bungeeConnectStringConnect player to another BungeeCord server
giveMoneyNumber or ObjectAdd money to a player. Routes through the configured economy provider.
takeMoneyNumber or ObjectWithdraw money from a player. Routes through the configured economy provider.
givePermissionStrings list or ObjectGrant a permission. Routes through the configured permissions provider.
removePermissionStrings list or ObjectRevoke a permission. Routes through the configured permissions provider.
addGroupString or ObjectAdd the player to a permissions group.
removeGroupString or ObjectRemove the player from a permissions group.
lpMetaSetObjectLuckPerms-only: set meta values on a user (metaList). Logs a warning and skips if the active permissions provider is not LuckPerms.
lpMetaRemoveStrings listLuckPerms-only: remove meta keys from a user. Logs a warning and skips if the active permissions provider is not LuckPerms.
setGamemodeStringSet new game mode for player. All available modes names can be found here
setHealthNumberSet player health level
setFoodLevelNumberSet player food level
giveXpNumber or ObjectGive XP points to a player. Goes through the levels provider.
takeXpNumber or ObjectTake XP points from a player.
giveLevelNumber or ObjectIncrease the player’s level.
takeLevelNumber or ObjectDecrease the player’s level.
soundObjectPlay sound
customSoundObjectPlay custom sound from resource pack
potionEffectObjects listGive potion effect to player
removePotionEffectStrings listRemove potion effect from player
openBookObjectCreate and open a written book for player
setPropertyObjectSet new or overwrite existing properties for the menu item
remPropertyObjects listRemove specified properties from the menu item
refreshItemMultipleUpdate only one menu item, without updating the entire menu
setSkinObjectSet the player’s skin. Routes through the configured skin provider.
resetSkinBooleanReset the player’s skin via the same provider.
addRecipeObjects listAdd new custom recipes for crafting
setButtonObjects listSet the new button to displayed menu
removeButtonSlot (number, range, matrix)Remove button from displayed menu (see drag-and-drop)
placeItemObjects listFor drag-and-drop. Place draggable item into draggable slot (see drag-and-drop)
removePlacedSlot or ObjectRemove a draggable item from the menu (see drag-and-drop)
Global variables
setVarObjects list, Strings listCreate or replace global variable
removeVarObjects list, Strings listRemove global variable
incVarObjects list, Strings listIncrement global numeric variable
decVarObjects list, Strings listDecrement global numeric variable
mulVarObjects list, Strings listMultiply global numeric variable
divVarObjects list, Strings listDivide global numeric variable
Personal variables
setVarpObjects list, Strings listCreate or replace personal variable
removeVarpObjects list, Strings listRemove personal variable
incVarpObjects list, Strings listIncrement personal numeric variable
decVarpObjects list, Strings listDecrement personal numeric variable
mulVarpObjects list, Strings listMultiply personal numeric variable
divVarpObjects list, Strings listDivide personal numeric variable
Special actions
delayObjectWrap actions block to perform they after some delay
bulkObjects listPerform many actions, even of one type
randActionsObjects listPerform random actions block from the list
playerScopeObjectPerform actions for other player
For generated menus
pagePrevNumberSwitch to one of the previous page. Works only with generated menus
pageNextNumberSwitch to one of the next page. Works only with generated menus

Money, level, permission, placeholder, and skin actions all go through AbstractMenus’s pluggable provider system. Out of the box, Vault handles money / permissions, LuckPerms handles permissions / groups, vanilla XP backs the levels section, and SkinsRestorer backs skins. Drop in an addon like PlayerPointsAddon and you get a second economy provider on the same server.

The default config.conf providers.<section> value is "auto": AbstractMenus picks the highest-priority registered provider. Bundled providers register at priority 50, addon providers typically at 100, so an addon wins auto-resolution unless an operator explicitly pins a different id.

takeMoney: 100

Resolves through config.conf providers.economy. Set to "auto" (the default) to pick the highest-priority registered provider; pin a specific id like "vault" or "playerpoints" to override.

Object form lets you name the provider explicitly. Useful when one menu mixes currencies — coins for buying items, points for the lottery:

actions {
click: [
{ type: takeMoney, amount: 100, provider: "vault" } // server economy
{ type: giveMoney, amount: 5, provider: "playerpoints" } // donor tokens
]
}

If every menu should use PlayerPoints, edit plugins/AbstractMenus/config.conf:

providers {
economy = "playerpoints"
}

Now the scalar form (takeMoney: 100) routes through PlayerPoints automatically.

When AbstractMenus runs a money/level/permission action, it picks the handler in this order:

  1. Per-action provider: "..." — wins outright if present.
  2. config.conf providers.<section> — used if a non-auto value is set.
  3. Priority-based auto-resolve — highest registered priority wins. Built-in providers register at priority 50; addons typically at 100, so addon providers win unless you pin Vault explicitly.

The same shape applies to giveLevel/takeLevel (levels), givePermission/removePermission/addGroup/removeGroup (permissions), and setSkin/resetSkin (skins). Just swap economy for the relevant section name in config.conf.

For implementing your own provider, see Provider handlers.

Action for send various text information to player. For example:

message {
chat: [
"Line 1",
"line 2"
]
title: "Title"
subtitle: "Subtitle"
fadeIn: 10
stay: 20
fadeOut: 10
actionbar: "&aHello"
json: "{'text'='Hello'}"
}

This block has many parameters that can be used separately.

NameData typeDescription
chatStrings listSend personal message to chat
actionbarStringSend text to player’s action bar
jsonStringSend personal JSON message to chat. Works on MC 1.9+
Title parameters
titleStringSend title
subtitleStringSend subtitle
fadeInNumberFade in time in ticks
stayNumberStay time in ticks
fadeOutNumberFade out time in ticks

You can also use the message block as a simple text parameter. Then this action will send chat message to the player.

message: "Single message"

JSON message can be specified not only as a string, but also using the HOCON syntax. Example:

message {
   json {
     text: "&aSome text"
     hoverEvent {
       action: "show_text"
       value: "&eSome text"
     }
   }
}

This block is equivalent to this JSON message:

message {
   json: "{'text':'&aSome text', 'hoverEvent':{'action':'show_text', 'value':'&eSome text'}}"
}

Action to execute command on behalf of player or server. Example:

command {
player: [
"command 1",
"command 2"
]
console: [
"command 1",
"command 2"
]
}

This action will execute two commands. Commands /command 1 and /command 2 will be executed by player and same by server.

You can also execute commands only by player or server:

command { player: "command 1" }

And same with console block.

By default, all commands have placeholders resolved before being dispatched. Set ignorePlaceholder: true to send the raw command string verbatim - useful when a command argument literally contains % characters.

command {
console: "lp user %player_name% permission set foo.bar true"
ignorePlaceholder: false // default; resolves %player_name%
}

This action will close menu and ask player to enter some text in the chat. After text entered, plugin will save it into variable.

All about chat input feature read on the Chat input page.

Teleport player to specified location. Example:

teleport {
world: "world"
x: 0.0
y: 100.0
z: 0.0
yaw: 0.0
pitch: 0.0
}

This action also has short version:

teleport: "world, 0.0, 100.0, 0.0, 0.0, 0.0"

Add item or items to player’s inventory. Item has the format described on the item format page. Example:

itemAdd: [
{
slot: 0
material: STONE
name: "My stone"
},
{
material: CAKE
name: "My cake"
}
]

Items without slot will be added in the first empty slot in inventory

This action same as itemAdd. But items will be removed in specified slot. If slot is not specified, item will be removed by comparing with specified parameters. Example:

itemRemove: [
{
slot: 0
material: STONE
name: "My stone"
},
{
material: CAKE
name: "My cake"
}
]

Action to play sound. Below all parameters that can be specified:

sound {
name: "SOUND_NAME"
volume: 1.0
pitch: 1.0
public: false
location {
world: "world"
x: 0.0
y: 0.0
z: 0.0
}
}

Parameter name required. All parameters are optional.

  • name - Bukkit’s name of the sound. See all sound names here

  • volume - Volume of the sound. Value between 0.0 and 1.0.

  • pitch - Pitch of the sound. Value between 0.0 and 10.0.

  • public - Is this sound will be played for all near players.

  • location - Location in which sound will play. Location format is the same as in the teleport action.

You can also use short format:

sound: "SOUND_NAME"

In this case, the sound will play only for player in player’s location.

Same as the sound action, but accepts a sound name from a resource pack. Example:

customSound: "name.songs_sound"

When used as an object, the action accepts every parameter sound does, plus a sound category:

customSound: {
name: "name.songs_sound"
category: RECORDS
volume: 1.0
pitch: 1.0
public: false
location {
world: "world"
x: 0.0
y: 0.0
z: 0.0
}
}
  • name - Resource-pack sound name (e.g. name.songs_sound). Required.
  • category - One of the values defined here. Default MASTER.
  • volume - Volume. Default 1.0.
  • pitch - Pitch. Default 1.0.
  • public - If true, plays for nearby players too. Default false.
  • location - Location in which sound will play. Same shape as in the teleport action. Default: the player’s current location.

Action to add a potion effect to player.

potionEffect: [
{
effectType: FAST_DIGGING
duration: 100
amplifier: 1
}
]

The format of this action is similar to the potionData item property.

Action to remove potion effects from player. Example:

removePotionEffect: [
FAST_DIGGING,
SPEED
]

Action above will remove two potion effects from player.

Action to open a written book. The format mirrors the bookData item property.

openBook {
author: "Peter Piper"
title: "&e&lSuper Title"
pages: [
"A content of the first page",
"A content of the second page",
"..."
]
}

LuckPerms-only actions to read or write LuckPerms meta values on a user. They go through the active permissions provider and only fire when that provider is LuckPerms; otherwise they log a warning and skip.

lpMetaSet {
ignorePlaceholder: false
metaList: [
{ key: "prefix", value: "&7[Member]" }
{ key: "suffix", value: "&8[%player_world%]" }
]
}
  • metaList - List of { key, value } pairs. value is run through placeholder substitution unless ignorePlaceholder is true.
  • ignorePlaceholder - If true, send the raw value verbatim. Default false.

Removes meta keys from the user. Accepts a single string or a list:

lpMetaRemove: "prefix"
lpMetaRemove: [ "prefix", "suffix" ]

These actions for create, update, delete, and do some math with variables.

There are two version of each variable-related action - global and personal. For example there is setVar and setVarp actions for global and personal variables, respectively.

Actions to interact with global variables.

Action to create or update global variable. It can be specified in one of the following format:

setVar: "<var_name>::<value>"
setVar: "<var_name>::<value>::<time>"
setVar: "<var_name>::<value>::<replace>"
setVar: "<var_name>::<value>::<time>::<replace>"

Where:

<var_name>
Name of the variable

<value>
Any value of variable. String or numeric.

<time>
Optional. Variable lifetime.

<replace>
Optional. If false and variable with this name exists then it won’t be replaced with new value. By default is true

Simple example:

setVar: "my_var::Some data"

This action will create global variable with name my_var and string value Some data.

You can create a temporary variable. A temporary variables will be automatically removed after specified time. To set a lifetime for the variable you need to add time parameter. Example:

setVar: "my_var::Some data::10m"

Here, we created and set lifetime in 10 minutes for the variable my_var. You can specify lifetime by seconds (s), minutes (m), hours (h) and days (d). Also you can combine it. For example:

1d 12h
1 day (24 hours) and 12 hours

2h 30m
2 hours and 30 minutes

10s 10h
10 hours and 10 seconds

If you want to protect a created variable from rewriting, you can use the last <replace> argument:

setVar: "my_var::Some data::false"

Here, the false is a <replace> argument, not <time>. If we use boolean in third argument, and there is only 3 arguments, plugin suppose this is a <replace>. Note, that this is not protects variable from rewriting by other action, where replace is true.

Action to remove global variable. Example:

removeVar: "my_var_name"

This action has only one argument - name of the global variable.

There is several actions to do math operations with variables:

  • incVar - Increment variable

  • decVar - Decrement variable

  • mulVar - Multiply variable

  • divVar - Divide variable

If variable with specified name doesn’t exists, plugin will create a new one with specified value.

Below is the example of using incVar action.

incVar: "my_var::2"

This action will increment variable my_var on 2.

Other math actions has the same format. Some examples:

decVar: "my_var::10"
mulVar: "my_var::3"
divVar: "my_var::2"

All variable-related actions has full format. These actions can be specified as objects. For example, this is format of setVar action:

ParameterTypeDescriptionRequired
nameStringUnique name of the variabletrue
valueStringValue of the variabletrue
timeStringVariable lifetimefalse
replaceBooleanIf false and variable with this name exists then it won’t be replaced with new value. By default is truefalse
playerStringCreate personal variable for specific player. This is legacy part of this action. Use special actions for personal variables insteadfalse

Example:

setVar {
name: "myvar"
value: "Hello, world"
}

The same for other actions, like removeVar and all math actions.

This format is still works for backward compatibility or in cases when you have big and complex string to save.

Actions to interact with personal variables.

Action setVarp used to create personal variable for player who opened menu. This action has same format as the global setVar action.

Example:

setVarp: "myvar::Hello, world"

Same as the Temporal variable section for global variables, but using setVarp action.

Same as the Rewriting safety section for global variables, but using setVarp action.

To remove personal variable, use the removeVarp action. This action has same format as for global variables:

removeVarp: "my_var_name"

There is several actions to do math operations with personal variables:

  • incVarp - Increment personal variable

  • decVarp - Decrement personal variable

  • mulVarp - Multiply personal variable

  • divVarp - Divide personal variable

All arguments and usage similar to the Math actions of global variables.

incVarp: "myvar::2"

In some cases you need to set, remove, or change multiple variables. For this, you can use any variable action as list. Example:

Example 1. Set multiple global variables.

setVar: [
"variable_1::Value of variable 1",
"variable_3::Value of variable 2",
"variable_3::Value of variable 3"
]

Example 2. Remove multiple global variables.

removeVar: [
"variable_1",
"variable_3",
"variable_3"
]

Example 3. Increment multiple personal variables.

incVarp: [
"var_1::2",
"var_3::5",
"var_3::8"
]

This action is a kind of wrapper for other actions. It has two parameters:

  • delay - Delay in ticks before performing actions block.

  • actions - The actions block, similar to all others. All actions and rules inside will be performed after the time specified in delay block has expired.

Example for click block:

click {
  message: "Hi!"
  delay {
    delay: 20
    actions {
      itemAdd {
        material: CAKE
        name: "&bYour cake"
      }
    }
  }
  closeMenu: true
}

In this example, the sequence of execution will be as follows:

  1. Sends message “&aHi!”.
  2. Menu closes.
  3. After 20 ticks, a cake will be added to the player’s inventory.

Actions wrapper to perform many actions with similar names in a certain sequence. It takes a list of individual actions groups.

bulk: [
{
message: "Hello!"
sound: ENTITY_VILLAGER_NO
},
{
sound: ENTITY_VILLAGER_YES
},
{
sound: BLOCK_NOTE_BLOCK_PLING
}
]

Each element of the list is a separate group of actions, the same as in the usual actions block. This division into groups allows you to perform similar actions several times.

Actions wrapper to perform one, randomly selected actions block. When the time comes to execute the randActions action, this will execute random actions block from list. Example:

randActions: [
{
message: "Action 1"
},
{
message: "Action 2"
},
{
message: "Action 3"
}
]

After performing this action several times player will see different messages.

If you need to execute some actions for another player, you can use special actions wrapper called playerScope. Example:

playerScope {
name: "%player_name_placeholder%"
actions {
message: "Hello, %player_name_placeholder%"
}
}

The message inside actions block will be executed for player who found by name, entered in name field.

Here actions is a simple actions block. But all actions or rules inside will be related to found player. Example with additional rules:

playerScope {
name: "%player_name_placeholder%"
actions {
rules {
gamemode: SURVIVAL
}
actions {
message: "Hello, %player_name_placeholder%"
}
}
}

Here, the rules block will check found player, not player who opened menu.

To manipulate skins, AbstractMenus uses the SkinsRestorer plugin.

To set the skin to the player, you need to have its texture and signature. You can get them, for example, by uploading an image to MineSkin. Next, copy the data from the fields “Texture Data” and “Texture Signature” into the corresponding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FHS1gJmI9XYGlK8G24FP8GLljW5RLfHDc672UVzdwI3m4vuFeraLjl4="
}

Action to add recipe to player. This is a list of objects where each object is a recipe.

addRecipe: [
{
key: "my_recipe"
shape: [
" A ",
"ABA",
" A "
]
ingredients {
A: STONE
B: GRASS
}
result {
material: EMERALD
name: "Super emerald"
}
}
]

There is several required parameters:

  • key - Unique id (name) of the recipe.

  • shape - Workbench cells. It shows in which shape you want to layout the objects.

  • ingredients - Set ingredients in the <key>: <material> format. A and B are those designations from the shape parameter. Only materials supports.

  • result - The item, which player receive after crafting.

As a result, in order to craft our item, you need to put the corresponding items in the desired cells, as shown in the picture.

Workbench content

Action to add property to the menu item. Example:

items: [
{
slot: 0
material: STONE
name: "Properties test"
click {
setProperty {
glow: true
}
}
}
]

After click the item will glow.

This action also allows you to change the properties of other items in the opened menu. To do this, you need to specify the slot in which it is located. Example:

items: [
{
slot: 0
material: STONE
name: "Button 1"
click {
setProperty {
slot: 1 // Slot of the another button
glow: true
lore: "You've clicked on Button 1"
}
}
},
{
slot: 1
material: STONE
name: "Button 2"
}
]

Action to remove the specified properties from the menu item. To do this, you must specify a list of names for these properties. This action, like setProperty, only affects the copy of the menu that the player has opened. It does not change the properties of items globally.

items: [
{
slot: 0
material: STONE
name: "Button 1"
glow: true
click {
remProperty: [
"glow",
"name"
]
}
},
]

If you click on this button, only material property will remain. If you reopen the menu, the deleted properties will return.

You can remove the properties of another item in the opened menu. To do this, the remProperty block needs to be turned into an object with two elements - the slot parameter and the list of property properties.

items: [
{
slot: 0
material: STONE
name: "Button 1"
click {
remProperty {
slot: 1
properties: [
"glow",
"lore"
]
}
}
},
{
slot: 1
material: STONE
name: "Button 2"
glow: true
lore: [
"This is a button 2"
]
}
]

Now when you click on Button 1 you will remove the glow and lore properties of Button 2.

Refresh only one item from the whole menu. This is very useful for optimizing your menus because instead of updating the entire menu with all items, you just update one item, which makes it work faster and reduces the server load.

This action has three modes.

Refreshes the current menu item. Example:

items: [
{
slot: 0
material: STONE
name: "Xp is: %player_xp%"
click {
giveXp: 100
refreshItem: true
}
},
]

Refresh the current menu item with a delay specified in ticks.

items: [
{
slot: 0
material: STONE
name: "Xp is: %player_xp%"
click {
giveXp: 100
refreshItem: 20 // Ticks instead of 'true'
}
}
]

Update item in the specified slot. Optionally, you can specify a delay.

items: [
{
slot: 0
material: STONE
name: "Button"
click {
giveXp: 100
refreshItem {
slot: 1
delay: 20 // Optional
}
}
},
{
slot: 1
material: STONE
name: "Xp is: %player_xp%"
},
]

This action will add interactable item to the menu. Example:

setButton {
slot: 4
material: CAKE
name: "New button"
click {
message: "&aHello!"
}
}

After executing this action, specified button will be added to the slot 4. If some button already was in this slot, it will be replaced.

This action will remove displayed button from opened menu. This action accepts slot in any available format. Example:

removeButton: 4

This action will remove menu item from slot 4 if it exists. You can also use other slot formats:

removeButton: "0-8"

This action will remove items from slots 0, 1, 2, ..., 8