Skip to main content

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 all players on the server.
  • Options
    • <message> The message to broadcast
    • [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
  • 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
  • Syntax
    • delay{ticks=<ticks>}
Flight
  • Description: Sets whether a play can fly
  • Options
    • <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 the separator being a comma
      • The first parameter is the effect, the second the duration, and the final the amplifier
      • Example: give-effects{effects=[speed 300 1,jump_boost 300 2]}
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
  • Syntax
    • health{health=<health>;hunger=<hunger>}
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
  • 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]}
Leave
  • Description: Causes a player to leave the competition
  • Syntax
    • 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
  • 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
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
  • Syntax
    • 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]}
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
  • 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]}