> 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/combat-api.md).

# Combat API

`EdMobSwordsCombatAPI` — damage numbers, landing hits, auto-hit and frenzy.

```java
EdMobSwordsCombatAPI combat = EdMobSwordsAPI.getInstance().getCombatAPI();
```

***

### Methods

#### `getSwordDamage(Player player)`

The player's sword damage against zone mobs: `combat.damage` with `{skin-damage}`, placeholders, math and the sword-damage booster applied.

#### `getServerSwordDamage(Player player)`

The damage against real server mobs (`server-mobs.damage`).

#### `getSkinDamage(Player player)`

The `damage` of the player's equipped sword skin and tier (what `{skin-damage}` resolves to); `0` without skins.

#### `getDamageBoost(Player player)`

The total sword-damage booster multiplier (`1` = none).

#### `hitMob(Player player, SwordTarget target, double damage, String enchantSource)`

Hits a target on behalf of the player: damage number, hurt flash, boss bar, death, rewards and respawn run exactly as for a swing. `enchantSource` may be `null` — a `null` source is treated as a real swing and rolls the sword enchants; a hit attributed to an enchant never procs enchants again. Returns `true` when the hit killed the target.

#### `hitMob(Player player, int entityId, double damage, String enchantSource)`

Same for one of the player's packet mobs by entity id.

#### `startAutoHit(Player player, int entityId)` / `stopAutoHit(Player player)` / `getAutoHitTarget(Player player)`

Control the auto-hit loop (what a left click starts). `getAutoHitTarget` returns `-1` when idle.

#### `applyFrenzy(Player player, double speedMultiplier, long durationTicks)` / `isFrenzied(Player player)`

Temporarily speeds up the player's auto-hit.

#### `getNearbyMobs(Player player, Vector center, double radius, int limit)` / `getRandomMob(Player player)`

Alive mobs of the player's zone around a point (nearest first, `limit` 0 = all), or a random one.

#### `isHoldingSword(Player player)`

Whether the player holds the sword tool (main-thread snapshot, refreshed every 10 ticks).
