> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edmobswords/api/zones-api.md).

# Zones API

`EdMobSwordsZonesAPI` — the mob zones and the players fighting in them.

```java
EdMobSwordsZonesAPI zones = EdMobSwordsAPI.getInstance().getZonesAPI();
```

A player in a `global` EdTools session shares one mob population with every other player of that session; a player in an `alone` session has private mobs.

***

### Methods

#### `getMobZoneIds()` / `isMobZone(String zoneId)`

The loaded mob zones (EdTools zones with a `mobs:` section).

#### `getPlayerMobZone(Player player)`

The mob zone the player is fighting in, or `null`.

#### `isPlayerFighting(Player player)`

Whether the player has mobs spawned for them.

#### `isPlayerInSharedSession(Player player)`

Whether their mobs are shared with the other players of their global session.

#### `getPlayerMobs(Player player)`

The alive mobs the player can see and hit, as `SwordTarget`s. Empty outside a mob zone.

#### `getPlayerMob(Player player, int entityId)`

One of the player's mobs by client-side entity id, or `null`.

#### `getSessionPlayers(Player player)`

The other players sharing the player's mobs. Empty when private or outside a zone.

#### `getSpawnPoints(String zoneId)`

The spawn points of a zone in file order, as `SpawnPointInfo(mobId, x, y, z, yaw, pitch)`.

#### `addSpawnPoint(String zoneId, SpawnPointInfo point)` / `removeSpawnPoint(String zoneId, int index)` / `setSpawnPoints(String zoneId, List<SpawnPointInfo> points)`

Edit the spawn points: the zone file is saved (only its `spawn-points` lines) and the mobs of everyone in the zone are rebuilt. Return `false` for an unknown zone.

#### `getRespawnTicks(String zoneId)`

The zone's default respawn delay.

#### `respawn(String zoneId)` / `respawn(Player player)`

Rebuild the population(s) of a zone, or the player's own one (their whole shared population in a global session).

#### `reloadZones()`

Re-reads every zone file and loads new ones into EdTools.
