Action Reference
Overview
This page contains all the actions built in to BattleArena natively. Additional modules or extensions may add new actions, which will be included on their documentation page.
Actions List
- <, > denotes a required option
- [, ] denotes an optional option
Broadcast
- Description: Broadcasts a message to the specified audience
- Options
- <message> The message to broadcast
- [audience] Who the message will be broadcasted to. Can be game or server (default game)
- [type] The type of message. Can be chat, action_bar, title, subtitle (default: chat).
- Syntax
- broadcast{message=<message>;type=[type]}
Change Gamemode
- Description: Changes the player's gamemode
- Options
- <gamemode> The gamemode to set the player to
- Syntax
- change-gamemode{gamemode=<gamemode>}
Change Role
- Description: Changes the player's role
- Options
- <role> The role to set the player to. Can be playing or spectating
- <role> The role to set the player to. Can be playing or spectating
- Syntax
- change-role{role=<role>}
Clear Effects
- Description: Clears all of a player's effects
- Syntax
- clear-effects
Clear Inventory
- Description: Clears a player's inventory
- Syntax
- clear-inventory
Delay
- Description: Delays any subsequent actions by a specified duration
- Options
- <ticks> The amount of time to delay the next action
- <ticks> The amount of time to delay the next action
- Syntax
- delay{ticks=<ticks>}
Flight
- Description: Sets whether a play can fly
- Options
- <enabled> Whether the player can fly
- <enabled> Whether the player can fly
- Syntax
- flight{enabled=<enabled>}
Give Effects
- Description: Gives potions effects to a player
- Options
- <effects> The effects to give to the player
- Syntax
- give-effects{effects=<effects>}
- The effects syntax is in a list format, with root object being the effect name, and the parameters specified inside
- Example: give-effects{effects=[speed{duration=300;amplifier=1},jump_boost{duration=300;amplifier=1}]}
- The effects syntax is in a list format, with root object being the effect name, and the parameters specified inside
- give-effects{effects=<effects>}
Give Item
- Description: Gives an item to a player
- Options
- <item> The item to give to the player
- [slot] The slot to place the item in. If unspecified, it will be added to the next available slot
- Syntax:
- give-item{item=<item>;slot=[slot])
- See the Item Syntax page for how to format items in this section
- give-item{item=<item>;slot=[slot])
Health
- Description: Sets the player's health and hunger values
- Options
- <health> The health to set for the player
- <hunger> The hunger to set for the player
- <health> The health to set for the player
- Syntax
- health{health=<health>;hunger=<hunger>}
Join Random Team
- Description: Makes a player join a random team. Only runs on players who have not selected a team already
- Syntax
- join-random-team
Kill Entities
- Description: Kills all entities within the map bounds
- Options
- [excluded-groups] The group of entities to exclude. If left empty, all entities are killed aside from players
- The following options are allowed: monster, animal, water_animal, water_ambient, water_underground_creature, ambient, axolotl
- [excluded-groups] The group of entities to exclude. If left empty, all entities are killed aside from players
- Syntax
- kill-entities{excluded-groups=<excluded-groups>}
- The kill-entities syntax is in a list format, with the separator being a comma
- Example: kill-entities{excluded-groups=[monster,axolotl]}
- kill-entities{excluded-groups=<excluded-groups>}
Leave
- Description: Causes a player to leave the competition
- Syntax
- leave
- leave
Play Sound
- Description: Plays a sound to the player
- Options
- <sound> The sound to play
- [pitch] The pitch of the sound. Values between 0 and 2 are allowed
- [volume] The volume of the sound
- <sound> The sound to play
- Syntax
- play-sound{sound=<sound>;pitch=[pitch];volume=[volume]}
Reset State
- Description: Resets the state of a player. This will clear all of their stats, and make them leave their current team (and rejoin a random one if applicable)
- Syntax
- reset-state
Respawn
- Description: Causes a player to automatically respawn
- Syntax
- respawn
- respawn
Restore
- Description: Restores player data that was previously stored
- Options
- <type> The type of data to restore.
- The following options are available: all, inventory, gamemode, health, attributes, experience, flight, effects, location
- <type> The type of data to restore.
- Syntax
- restore{types=<types>}
- restore{types=<types>}
Run Command
- Description: Runs a command
- Options
- <command> The command to run
- [source] The source of the command Can be player or console (default: player)
- Syntax
- run-command{command=<command>;source=[source]}
- run-command{command=<command>;source=[source]}
Send Message
- Description: Sends a message to the player
- Options
- <message> The message to send
- [type] The type of message. Can be chat, action_bar, title, subtitle (default: chat).
- Syntax
- send-message{message=<message>;type=[type]}
Store
- Description: Stores player data that should later be restored. Allows for instances where games may have their own inventories, but player inventories should be restored later
- Options
- <type> The type of data to restore.
- The following options are available: all, inventory, gamemode, health, attributes, experience, flight, effects, location
- <type> The type of data to restore.
- Syntax
- store{types=<types>}
Teardown
- Description: Tears down a competition and removes it from starting again. Often used for event competitions, which close once the event has concluded
- Syntax
- teardown
Teleport
- Description: Teleports a player to a location in a map
- Options
- <location> The location to teleport the player. Can be waitroom, spectator, team_spawn or last_location
- [random] Whether the teleport is randomized. Only used for the team_spawn option
- Syntax
- teleport{location=<location>;random=[random]}
- teleport{location=<location>;random=[random]}