Commands

Actions support some custom commands. Note that these are not actual commands that can be executed in chat and they only work inside actions.

Commands

Regular

  • sound - send a sound to a player

  • message - send a message to a player

  • delay - send multiple commands to player after a delay

Variables

Regular

sound

Send a sound to the player viewing the tooltip.

Arguments

  1. sound name

    • used exactly the same way as in the /playsound command.

    • list of vanilla sounds can be found here

  2. sound category

    • used exactly the same way as in the /playsound command.

    • list of sound categories can be found here (on the right)

  3. volume (float)

  4. pitch (float)

Examples

actions:
  on-show:
  - sound minecraft:block.amethyst_block.break master 1 1
  right-click:
  - sound custom:mysoundname master 1 1

message

Send a message to the player viewing the tooltip. Supports hex, PAPI placeholders and local placeholders.

Arguments

Message

Examples

actions:
  on-show:
  - message Welcome traveller!
  left-click:
  - message &cOuch!

delay

Send an array of commands to the player viewing the tooltip after a specific given delay. Commands are separated with a ; and support both local commands (on this page) and outside commands. Supports all placeholders.

Arguments

Time (ticks, 1 second = 20 minecraft ticks)

Commands (separated with a ; )

Examples

actions:
  on-stop-showing:
  # After 1 second, message hello and kill the player
  - delay 20 message Hello!; kill %player%
  # After 5 seconds, set variable meow to false
  - delay 100 setvar player meow false

Variables

setvar

Set a non-persistent variable for the given player or globally. Supports PAPI placeholders and local placeholders.

Arguments

Scope [ player / global / insert players name ]

Variable name (supports placeholders)

Value (supports mathematical evaluation)

Examples

actions:
  on-stop-showing:
  # Scope here is global,
  # variable name is meow 
  # and value is 1
  - setvar global meow 1

setpersistentvar

Set a persistent variable for the given player or globally. Supports PAPI placeholders and local placeholders.

Arguments

Scope [ player / global / insert players name ]

Variable name (supports placeholders)

Value (supports mathematical evaluation)

Examples

actions:
  on-stop-showing:
  # Add 1 for each time the player looks at this tooltip
  - setpersistentvar player looked %persistentvar_looked% + 1

clearvar

Clear a non-persistent variable for the given player or globally. Supports PAPI placeholders and local placeholders.

Arguments

Scope [ player / global / insert players name ]

Variable name (supports placeholders)

Examples

actions:
  on-stop-showing:
  # Clears the "meow" variable, effectively removing it
  - clearvar player meow 

clearpersistentvar

Clear a persistent variable for the given player or globally. Supports PAPI placeholders and local placeholders.

Arguments

Scope [ player / global / insert players name ]

Variable name (supports placeholders)

Examples

actions:
  on-stop-showing:
  # Clears the "meow" variable, effectively removing it
  - clearpersistentvar player looked 

clearvars

Clear all non-persistent variables for either a given player or globally.

Arguments

Scope [ player / global / insert players name ]

Examples

actions:
  on-stop-showing:
  # Clear all global variables
  - clearvars global
  # Clear all players variables
  - clearvars player

clearpersistentvars

Clear all persistent variables for either a given player or globally.

Arguments

Scope [ player / global / insert players name ]

Examples

actions:
  on-stop-showing:
  # Clear all persistent global variables
  - clearpersistentvars global
  # Clear all persistent players variables
  - clearpersistentvars player

savepersistentvars

Save all persistent variables.

Examples

actions:
  on-stop-showing:
  - savepersistentvars

Last updated