-
Notifications
You must be signed in to change notification settings - Fork 12
3.6 Available Action Prefixes
An empty prefix means that the action is a command which will be executed by the target player directly.
console
means that the main part of the action will be executed by the server console.
tell
means that the main part will be sent to the target player. Formatting codes are available.
tellraw
means that the main part will be treated as a raw json message and be sent to the player.
broadcast
means that the main part will be broadcasted to all the online players. Formatting codes are available.
title
means that the main part will be sent to the target player's action bar. It does not represents the title shown in the center of the game interface. The existence of the name, title
, is just a historical legacy. If you want to use the one shown in the center of the game interface, please use bigtitle
and subtitle
instead.
bigtitle
means that the main part will be shown in the center of the target player's client GUI. Besides, the subtitle can be set by the subtitle
prefix. Formatting codes are available.
subtitle
means that the main part will be shown as a subtitle slightly below the center of the target player's client GUI. Formatting codes are available.
delay
means that all the actions after this one will be delayed for what is specified in the main part, the unit of which is tick (usually 0.05s). For example, delay: 20
means that all the following actions will be delayed for one second. Please do not specify an oversized value, because the subsequent actions may not be executed if the target player is teleported to another world out or the server closed.
connect
means that the target player will be teleported to another server whose name is specified in the main part. This prefix does not work normally unless BungeeCord is available.
cost
means that the target player will be tried to deduct a certain amount of money. The amount is specified by the main part of the action. Subsequent actions will be still executed while the player does not have enough money. Therefore, please check if the player is wealthy enough by using Requirements
.
cost-item
means that the target will be tried to remove a certain number of items held by the mouse cursor. The amount is specified by the main part of the action. Subsequent actions will be still executed while the player does not have enough items held by the mouse cursor. Please check if the player does hold something you want by using HandheldItem
.
sound
means that a sound event will be fired. The sound name (such as minecraft:block.chest.open
, minecraft:block.chest.close
, etc.) and sound volume (between 0.0 and 2.0 in most cases) can be speficied by the main part of the action which are seperated by a colon(:
). For example, sound: minecraft:block.chest.open:0.5
, sound: minecraft:block.chest.close:2.0
, etc. The sound volume is optional and the default value is 1 (sound: minecraft:block.chest.open
is equivalent to sound: minecraft:block.chest.open:1.0
).
sound-with-pitch
means that a sound event with particular sound pitch will be fired. It can even play a song with note block sounds and delay
s. The sound name, sound volume, and the sound pitch can be provided by the main part of the action orderly which are seperated by a colon(:
). For example, sound-with-pitch: minecraft:block.note.harp:0.5:1.5
, sound-with-pitch: minecraft:block.note.harp:2.0:3.0
, etc. The sound volume is optional and the default value is 1 (sound-with-pitch: minecraft:block.note.harp:1.5
is equivalent to sound-with-pitch: minecraft:block.note.harp:1.0:1.5
).