Skip to main content

Arena Configuration

Overview

BattleArena offers a significant amount of flexibility when it comes to configuring arenas. 

All arenas in BattleArena are located in the plugins/BattleArena/arenas directory. All of these can be modified, deleted and new ones can be added. For the sake of this tutorial, we will be working with the arena.yml arena configuration. Each set of options is documented below.

Standard Options

  • name: The name of the arena.
  • mode: The mode of the arena. BattleArena only comes with the "Arena" mode built in, but extension plugins may add new modes.
  • aliases: Command aliases to see available commands for this arena.
  • type: The type of arena. Can either be Match or Event. See the plugin overview page for what differentiates these two.

NOTE: Changing these options for arenas with existing maps may cause the maps to no longer be linked to the arena. If this occurs, be sure to update the map arenas in plugins/BattleArena/maps/<arena> YML files. You may need to rename the directory to be the same name as what is set in the name option above.

Team Options

Manages how to distribute players across teams along with options regarding the team size.

  • named-teams: Whether teams should be named (i.e. Red, Blue, etc.) See the teams page for more information about teams.
  • team-size: How many players this team fits. This can be a specific number, a range, or a minimum-inclusive range. See the following examples:
    • team-size: 4: Each team must have 4 players in order for a competition to start. Additionally, the team can only hold 4 players
    • team-size: 2-4: Each team can hold between 2 and 4 players. The competition will start once each team has at least 2 players.
    • team-size: 2+: Each team can hold 2 or more players (minimum-inclusive). The only limit is the number of spawns set in the map.
  • team-selection: How team selection is done in the competition. The following options are listed below:
    • none: No team selection. This is often used for solo competitions, where a player does not have a specific team and all other players are their enemies
    • random: BattleArena randomly assigns a player to a team.
    • pick: Players pick their team (usually during a countdown or waiting phase). This can be done using the /<arena> team <team> command. Server owners can also configure this to be done when the player clicks an NPC, sign or GUI button.

Lives

Controls how many lives players have in an arena. By default, this is disabled, 

  • enabled: Controls whether lives are enabled.
  • amount: How many lives a player has by default.

Victory Conditions

Controls how a player or team may "win" a competition. Each victory condition has its own set of options which determine how a player may win. Multiple can be set per competition, and once one condition is met, the competition ends. An example is shown below for the teams alive and time limit conditions.

victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m

In this example, a team will win the competition if they are the last team standing. However, if after 5 minutes there is no winner, the competition will end and all remaining players will draw.

A full list of victory conditions can be found on the Victory Conditions Reference page.

Events & Actions

This is where the bulk of logic for BattleArena is configured. Events denote when certain "things" happen in an arena, such as when a player joins, spectates, leaves, wins, dies, etc. Upon these events, actions can be ran which control the competition behavior. These can be as simple as sending a message to the player, clearing their inventory, or kicking them from the arena.

An example from the arena.yml is shown below for the on-join and on-leave events.

events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-leave:
    - restore{types=all}

As seen in the on-join event, when a player joins the arena, their state is stored. This includes their inventory, previous gamemode, health, attributes, experience, effects and last location. Their gamemode is also updated to adventure, flight is disabled for them, and they are teleported to the waitroom.

When the player leaves, as seen in the on-leave event, the player's previous state is restored. This will effectively restore everything that was stored when the store action was called.

A full list of events can be found on the Event Reference page. All actions can be found on the Action Reference page.

Options

The options section allows you to control mechanics while in the arena. The