Skip to content

Actions (actions)

The actions parameter allows you to "bring to life" the items in your menu. When a player clicks on an item with defined actions, the plugin executes the specified commands or operations.

This is a key tool for creating interactive buttons, links to other menus, giving rewards, changing reputation, and much more.

How it works?

You simply add an actions section to an icon's description (or to a state within an icon) and list the commands as strings.

yaml
# ...inside icons:
'c':
  material: CRAFTING_TABLE
  display: '&aOpen workbench'
  actions:
    - 'player: workbench' # Execute the /workbench command as the player
    - 'viewer_message: &eYou have opened the workbench!' # Send a message to the clicker
    - 'close_inventory' # Close the profile menu

When this item is clicked, all three actions will be executed sequentially.

List of available actions

Action (action)Description
player: <command>Executes a command as the player who clicked the item. The command should be written without a /.
console: <command>Executes a command from the server console. This is useful for actions requiring elevated permissions.
viewer_message: <message>Sends a chat message to the player who clicked the item (the viewer). Supports & color codes.
owner_message: <message>Sends a chat message to the profile owner. This is useful if you want to notify the owner about an action.
reputation: like(Reputation) Adds a "Like" to the profile owner from the viewer. Has a built-in 1.5s cooldown to prevent spam.
reputation: dislike(Reputation) Adds a "Dislike" to the profile owner from the viewer. Has a built-in 1.5s cooldown.
close_inventoryImmediately closes the profile menu.

Placeholders in actions

In all actions, you can use two special placeholders:

  • %owner% - will be replaced with the nickname of the profile owner.
  • %viewer% - will be replaced with the nickname of the one viewing the profile.

Also, if you have PlaceholderAPI installed, its placeholders will also work. They will be parsed from the perspective of the profile owner.

Example with reputation and placeholders:

yaml
actions:
  # Add a like to the profile owner
  - 'reputation: like'
  # Send a message to the clicker
  - 'viewer_message: &aYou successfully liked %owner%''s profile!'
  # Send a notification to the owner
  - 'owner_message: &ePlayer %viewer% liked your profile!'

Execution Control: action-executor

Sometimes you need a button that can only be clicked by the profile owner (e.g., "Settings") or, conversely, only by other players (e.g., "Report" or "Like"). The action-executor parameter exists for this purpose.

ValueDescription
BOTH(Default) Both the owner and viewers can click.
OWNEROnly the profile owner can click the item.
VIEWEROnly viewers (not the owner) can click.

Example:

yaml
# ...inside icons:
's':
  action-executor: OWNER # Only the owner can click
  material: COMPARATOR
  display: '&aSettings'
  actions:
    - 'player: profile-settings'