> 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/eddungeons/developers/eddungeons-api/zones-api.md).

# Zones API

### Overview

The zone system manages player progression through different dungeon areas, each with multiple stages and mob encounters. Players can join zone sessions, progress through stages, and interact with zone-specific mobs through both manual and automatic combat systems.

***

### Session Management

#### Zone Sessions

**`void joinSession(Player player, String zoneId)`**

* **Description:** Places a player into a specific zone session
* **Parameters:**
  * `player` - Player to join the zone
  * `zoneId` - Identifier of the zone to join
* **Usage:** Zone teleportation, progression advancement, zone switching

**`void leaveSession(Player player)`**

* **Description:** Removes a player from their current zone session
* **Parameters:** `player` - Player to remove from zone
* **Usage:** Zone exit, session cleanup, player logout handling

**`boolean isPlayerInSession(Player player)`**

* **Description:** Checks if a player is currently in any zone session
* **Parameters:** `player` - Player to check
* **Returns:** True if player is in a zone session, false otherwise
* **Usage:** Session validation, conditional zone features

#### Zone Information

**`String getPlayerZoneId(Player player)`**

* **Description:** Gets the ID of the zone the player is currently in
* **Parameters:** `player` - Player to check
* **Returns:** Zone identifier or null if not in a zone
* **Usage:** Display current location, zone-specific features, conditional logic

***

### Stage Progression

#### Stage Management

**`void setPlayerZoneStageId(Player player, String zoneId, String stageId)`**

* **Description:** Sets a player's progress stage within a specific zone
* **Parameters:**
  * `player` - Player whose stage to set
  * `zoneId` - Zone identifier
  * `stageId` - Stage identifier to set
* **Usage:** Progression rewards, stage unlocking, administrative advancement

**`String getPlayerZoneStageId(Player player, String zoneId)`**

* **Description:** Gets a player's current stage in a specific zone
* **Parameters:**
  * `player` - Player to check
  * `zoneId` - Zone to check stage for
* **Returns:** Stage identifier or null if no progress
* **Usage:** Display progression, unlock requirements, stage-specific features

***

### Mob Interaction

#### Mob Management

**`Set<Integer> getPlayerMobsInZone(Player player)`**

* **Description:** Gets the set of mob entity IDs available to the player in their current zone
* **Parameters:** `player` - Player to get mobs for
* **Returns:** Set of mob entity IDs in the player's zone
* **Usage:** Combat system integration, mob targeting, zone population

#### Combat System

**`void hitMob(Player player, int mobId, BigDecimal damage, boolean giveSwingCurrencies, boolean triggerEnchants)`**

* **Description:** Deals damage to a mob in the player's zone (fires the swing/death events as appropriate)
* **Parameters:**
  * `player` - Player performing the attack
  * `mobId` - Entity ID of the target mob
  * `damage` - Amount of damage to deal
  * `giveSwingCurrencies` - Whether to award the player's swing currencies for this hit
  * `triggerEnchants` - Whether this hit can trigger the player's enchants
* **Usage:** Manual combat, click-based attacks, interactive combat

**`EdEntity getMobEntity(Player player, int mobId)`**

* **Description:** Gets the mob EdEntity of a player (EdEntity class from EdLib)
* **Parameters:**
  * `player` - Player owning the mob
  * `mobId` - Entity ID of the target mob

**`BigDecimal getPlayerZoneMobHealth(Player player, int mobId)`**

* **Description:** Gets the mob health of a player zone
* **Parameters:**
  * `player` - Player owning the mob
  * `mobId` - Entity ID of the target mob

**`String getPlayerZoneMobConfigId(Player player, int mobId)`**

* **Description:** Gets the config ID (mob file name) of a mob in the player's zone
* **Parameters:**
  * `player` - Player owning the mob
  * `mobId` - Entity ID of the target mob


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://edseries-plugins.gitbook.io/p/eddungeons/developers/eddungeons-api/zones-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
