> For the complete documentation index, see [llms.txt](https://ajneb97.gitbook.io/conditionalevents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajneb97.gitbook.io/conditionalevents/actions/event-actions.md).

# Event Actions

These are special actions that only work with certain events.

## KEEP ITEMS

This action only works for [`player_death`](/conditionalevents/event-types/player-events.md#player-death) event type. Allows the player to keep their items or xp on death. Possible values: `items`, `xp`, `all`

```yaml
keep_items: items
keep_items: all
```

## CANCEL DROP

This action only works for [`block_break`](/conditionalevents/event-types/block-events.md#block-break) and [`player_kill`](/conditionalevents/event-types/player-events.md#player-kill) event types. It will completely cancel item drops from the block/entity. It only works on 1.13+.

```yaml
cancel_drop: true
```

## SET DAMAGE

This action only works for [`player_attack`](/conditionalevents/event-types/player-events.md#player-attack) and [`player_damage`](/conditionalevents/event-types/player-events.md#player-damage) event types. Allows to modify the final damage of the attack/damage taken.

```yaml
//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`](/conditionalevents/event-types/player-events.md#player-join) event type. Allows to completely hide the player join message.

```yaml
hide_join_message: true
```

## HIDE LEAVE MESSAGE

This action only works for [`player_leave`](/conditionalevents/event-types/player-events.md#player-leave) event type. Allows to completely hide the player leave message.

```yaml
hide_leave_message: true
```

## SET DEATH MESSAGE

This action only works for [`player_death`](/conditionalevents/event-types/player-events.md#player-death) and [`player_kill`](/conditionalevents/event-types/player-events.md#player-kill) event types. Allows to replace the player death message with a custom one. You can set it to "no" to hide the death message.

```yaml
set_death_message: &fAn angry cactus killed &e%player%&f.
set_death_message: no
```

## PREVENT JOIN

This action only works for [`player_pre_join`](/conditionalevents/event-types/player-events.md#player-pre-join) event type. Prevents the player from joining the server, with a custom message.

```yaml
prevent_join: &c&lERROR!\n&7You can't access this account with that IP.
```

## SET ITEM

This action only works for [`player_fish`](/conditionalevents/event-types/player-events.md#player-fish) event type. Allows to modify the item caught by the player.

{% hint style="info" %}
Item properties you can use are described on the [**Give Item**](/conditionalevents/actions.md#give-item) action.
{% endhint %}

{% hint style="info" %}
You must make sure that the player is receiving an item. For that you must check for some conditions first. See the examples below.
{% endhint %}

```yaml
set_item: <item_properties>
set_item: id:DIAMOND;name:&bSuspicious Diamond
```

```yaml
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`](/conditionalevents/event-types/block-events.md#block-break) and [`player_fish`](/conditionalevents/event-types/player-events.md#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.

```yaml
set_event_xp: 0
```

## TAB COMPLETE

This action only works for [`player_tab_complete`](/conditionalevents/event-types/player-events.md#player-tab-complete) event type. Allows to modify the commands arguments displayed for the player in chat.

```yaml
# 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
```

```yaml
# 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"
```

<figure><img src="/files/UTGvmsTyiBHQs9OihD5b" alt=""><figcaption></figcaption></figure>
