> For the complete documentation index, see [llms.txt](https://timsixths-plugins.gitbook.io/minigameapi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-alpha1/minigame-features/arena-system/arena.md).

# Arena

The arena has a lobby location, name as arena ID, and a Map of locations.

How to create a new instance of Arena?

The first parameter is an arena's name.

The second parameter is the lobby location.

The third parameter is a map of locations.&#x20;

<pre class="language-java"><code class="lang-java"><strong>ArenaFactory arenaFactory = MiniGame.getArenaFactory();
</strong><strong>Arena arena = arenaFactory.createArena("arenaName", player.getLocation(), new HashMap&#x3C;>());
</strong><strong>//or
</strong>Arena arena = arenaFactory.createArena("arenaName", player.getLocation());
</code></pre>

How to manage arena locations.

```java
void addLocation(name, location); //Addes new location
Map<String, Location> getLocations(); //Gets map of locations
void removeLocation(name); //Removes location from map
Location getLocationByName(name) //Gets location by name
Optional<Location> getLocation(name); //Gets location by name
```

Arena options (The arena stores options in YAML).

Thanks to arena options you can store some custom values.&#x20;

<pre class="language-java"><code class="lang-java">Options options = arena.options();
//or
Options options = arena.getOptionsOrCreate();

options.setValue("key", "value"); //sets the value
<strong>Object value = options.getValue("key"); //gets the value
</strong>Object value = options.getValueOrDefault("key", "default"); //gets the value, or default value 
</code></pre>
