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
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.
Lives
Controls how many lives players have in an arena. By default, this is disabled,
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