Event Actions
These are special actions that only work with certain events.
KEEP ITEMS
This action only works for player_death
event type. Allows the player to keep their items or xp on death. Possible values: items
, xp
, all
keep_items: items
keep_items: all
CANCEL DROP
This action only works for block_break
and player_kill
event types. It will completely cancel item drops from the block/entity. It only works on 1.13+.
cancel_drop: true
SET DAMAGE
This action only works for player_attack
and player_damage
event types. Allows to modify the final damage of the attack/damage taken.
//Sets a custom value
set_damage: 15
//You can increment or decrement the final damage by a certain %.
//If set_damage is 150% and the player does 10 of damage, now the damage will be 15.
//If set_damage is 25% and the player does 10 of damage, now the damage will be 2.5.
set_damage: 150%
set_damage: 25%
HIDE JOIN MESSAGE
This action only works for player_join
event type. Allows to completely hide the player join message.
hide_join_message: true
HIDE LEAVE MESSAGE
This action only works for player_leave
event type. Allows to completely hide the player leave message.
hide_leave_message: true
SET DEATH MESSAGE
This action only works for player_death
event type. Allows to replace the player death message with a custom one. You can set it to "no" to hide the death message.
set_death_message: &fAn angry cactus killed &e%player%&f.
set_death_message: no
PREVENT JOIN
This action only works for player_pre_join
event type. Prevents the player from joining the server, with a custom message.
prevent_join: &c&lERROR!\n&7You can't access this account with that IP.
SET ITEM
This action only works for player_fish
event type. Allows to modify the item caught by the player.
set_item: <item_properties>
set_item: id:DIAMOND;name:&bSuspicious Diamond
example:
type: player_fish
conditions:
- "%state% == CAUGHT_FISH" #Required
- "%caught_type% == DROPPED_ITEM" #Required
actions:
default:
- "set_item: id:DIAMOND;name:&bSuspicious Diamond"
SET EVENT XP
These actions only works for block_break
and player_fish
event types. Allows to modify the xp dropped when breaking a block or fishing. Set to 0 to prevent xp from being dropped.
set_event_xp: 0
TAB COMPLETE
This action only works for player_tab_complete
event type. Allows to modify the commands arguments displayed for the player in chat.
# Clears the current command arguments.
tab_complete: clear
# Sets the current command arguments.
tab_complete: set;<arg1>,<arg2>,<argN>
tab_complete: set;commands,economy,worlds
# Removes command arguments.
tab_complete: remove;<arg1>,<arg2>,<argN>
tab_complete: remove;worlds
# FULL EXAMPLE
Events:
# Tab completion for a new "/help" command.
custom_help_command_tab:
type: player_tab_complete
conditions:
# Checks when the player writes the "/help" command.
- "%main_command% == /help"
# If the player is about to write the first argument, execute the show_arguments_1 action group.
- "%args_length% == 1 execute show_arguments_1"
# If the player is about to write the second argument, and the first argument is "worlds",
# execute the show_worlds_arguments action group.
- "%args_length% == 2 and %arg_1% == worlds execute show_worlds_arguments"
actions:
# Clears the current arguments to display, and sets new ones.
show_arguments_1:
- "tab_complete: clear"
- "tab_complete: set;commands,economy,worlds"
# Sets new arguments to display, associated with the "/help worlds" command.
show_worlds_arguments:
- "tab_complete: set;overworld,nether,plots"
# Functionality for the new "/help" command.
custom_help_command:
type: player_command
conditions:
# Checks when the player uses the "/help" command.
- "%main_command% == /help"
# If the first argument is "commands", execute the help_commands action group.
- "%arg_1% == commands execute help_commands"
# If the first argument is "economy", execute the help_economy action group.
- "%arg_1% == economy execute help_economy"
# If the first argument is "worlds", execute the help_worlds action group.
- "%arg_1% == worlds execute help_worlds"
actions:
default:
- "cancel_event: true"
- "message: &cYou must use: &7/help <commands/economy/worlds>"
help_commands:
- "cancel_event: true"
- "message: &fThis is the help page for &a&lCOMMANDS"
help_economy:
- "cancel_event: true"
- "message: &fThis is the help page for &a&lECONOMY"
help_worlds:
- "cancel_event: true"
# We need to check for the second argument, so a call event can be used.
- "call_event: custom_help_command_worlds_argument;%selected_world%=%arg_2%"
# Functionality for the "/help worlds" command.
custom_help_command_worlds_argument:
type: call
conditions:
- "%selected_world% == overworld execute world_overworld"
- "%selected_world% == nether execute world_nether"
- "%selected_world% == plots execute world_plots"
actions:
default:
- "message: &cYou must use: &7/help worlds <overworld/nether/plots>"
world_overworld:
- "message: &fThis is the help page for &a&lWORLD &8- &e&lOVERWORLD"
world_nether:
- "message: &fThis is the help page for &a&lWORLD &8- &c&lNETHER"
world_plots:
- "message: &fThis is the help page for &a&lWORLD &8- &b&lPLOTS"

Last updated
Was this helpful?