# Integrations

All integrations are optional. CoreEngine starts without them too, only the respective extra features fall away, no errors.

## Overview

| Plugin | Adds | Without it |
|---|---|---|
| **PlaceholderAPI** | `%coreengine_...%` in chat, tab, holograms, messages | Placeholders just stay unresolved |
| **Vault** | Offer economy to other plugins or use a foreign one (`economy.internal: false`) | Economy runs normally, no bridge |
| **LuckPerms** | Prefix/suffix, groups, permission-based limits, group spawns | Limits only global, not per group |
| **CoreProtect** | Jobs exploit protection (no money for self-placed blocks), transaction logs | Simple RAM fallback (lost on restart) |
| **CoreEngineClaim** | Web "Claims" category, team claims | Claims category missing in the web panel |
| **WorldGuard / GriefPrevention** | RTP and mob teleport avoid protected regions/claims | RTP can land in foreign land |
| **BetterHud** | Balance, job and team events as a HUD popup | Shown as actionbar/chat |
| **Nexo / Carpentary** | Custom items/blocks/furniture in shops and jobs | Vanilla items only |

## PlaceholderAPI

Detected automatically. All placeholders:

| Placeholder | Description | Example |
|---|---|---|
| `%coreengine_balance%` | Raw balance | `1500.50` |
| `%coreengine_balance_formatted%` | With symbol/separator | `1,500.50 Coins` |
| `%coreengine_balance_short%` | Short with symbol | `⛃ 1,500.50` |
| `%coreengine_nick%` | Nickname (plain text) | `CoolName` |
| `%coreengine_nick_raw%` | Nickname with formatting | `<red>Cool</red>` |
| `%coreengine_has_nick%` | Has a nickname? | `true`/`false` |
| `%coreengine_homes_count%` | Set homes | `3` |
| `%coreengine_homes_limit%` | Home limit | `5` / `unlimited` |
| `%coreengine_rtp_count%` | RTP uses | `12` |
| `%coreengine_rtp_cooldown%` | Remaining cooldown | `30 seconds` / `0` |
| `%coreengine_rtp_cooldown_<world>%` | Cooldown per world | `2 minutes 15 seconds` |
| `%coreengine_rtp_price_<world>%` | RTP cost per world | `500.00 Coins` |
| `%coreengine_joinmsg%` / `_leavemsg%` | Custom join/leave message? | `true`/`false` |
| `%coreengine_team_name%` / `_tag%` / `_color%` | Team name, tag, colour | `CoolTeam` / `[CT]` / `red` |
| `%coreengine_team_rank%` / `_rank_id%` / `_rank_weight%` | Rank, id, weight | `Moderator` / `0` / `2` |
| `%coreengine_team_rank_count%` | Ranks in the team | `5` |
| `%coreengine_team_can_<perm>%` | May the player do this? | `yes`/`no` |
| `%coreengine_team_score%` / `_balance%` / `_members%` | Score, treasury, members | `4500` / `25000.00` / `8` |
| `%coreengine_team_level%` / `_level_name%` | Team level | `3` / `Silver` |
| `%coreengine_team_top_<n>%` | Team at rank n by score | `TopTeam` |
| `%coreengine_jobs_count%` / `_points%` | Active jobs, points | `3` / `150.00` |
| `%coreengine_jobs_name_<n>%` | n-th active job | `Miner` |
| `%coreengine_jobs_level_<job>%` / `_xp_<job>%` | Level, XP in a job | `15` / `250.5` |
| `%coreengine_jobs_income_<job>%` / `_title_<job>%` | Income, title | `5000.00` / `Expert Miner` |
| `%coreengine_sleep_percentage%` / `_sleeping%` / `_required%` | Sleep threshold, sleeping, required | `35` / `2` / `3` |
| `%coreengine_lp_prefix%` / `_suffix%` | LuckPerms prefix/suffix (text) | `[ADMIN]` |
| `%coreengine_lp_prefix_raw%` / `_suffix_raw%` | with formatting | `<gold>[ADMIN]</gold>` |
| `%coreengine_lp_group%` / `_group_display%` | Group, display name | `admin` / `Administrator` |

Usable in chat (`chat.*`), tab (`tab.yml`), holograms, join/leave messages and broadcasts.

## LuckPerms

Provides group, prefix/suffix, meta values, membership and numeric limits. **Permission-based limits** (highest value wins):

```text
homes.limit.<n> / homes.limit.unlimited
jobs.max.<n>    / jobs.max.unlimited
shop.limit.<n>  rtp.limit.<n>  jobs.maxlevel.<n>  jobs.boost.<mult>
```

**Group spawns** apply before the global spawn:

```yaml
spawn:
  group-spawns:
    vip:
      world: "world"
      x: 100
      y: 100
      z: 100
```

## CoreProtect

On every block break it checks whether the block was player-placed per history, then no job income is paid. Without CoreProtect, CoreEngine only remembers placed blocks in RAM (lost on restart).

Optional logs (toggle per module in `modules/*.yml`):

| Event | Log name in CoreProtect |
|---|---|
| Job block break | `#jobs-<player>` |
| Shop buy / sell | `#shop-buy-<player>` / `#shop-sell-<player>` |
| Team chest break | `#teamclaim-<player>` |

## Which module uses what

| Module | Integration | For |
|---|---|---|
| Jobs | CoreProtect, Nexo, Carpentary, BetterHud | Exploit protection, custom items, popups |
| Shop | CoreProtect, Nexo, Carpentary | Logs, custom items |
| Team | CoreProtect | Chest-break logs |
| RTP | WorldGuard, GriefPrevention | Avoid landing in foreign land |
| Chat/Tab | LuckPerms, Nexo | Prefix/suffix, symbols |

> **Tip:** The switches for Nexo/Carpentary/CoreProtect live in the module files (`jobs.yml` under `jobs.integrations.*`, `team.yml` under `team.integrations.coreprotect.*`). Only BetterHud has its own file.

## Example config (betterhud.yml)

```yaml
enabled: true

betterhud:
  elements:
    balance:
      enabled: true
      popup-name: ""
      popup-duration: 60
    team-tag:
      enabled: true
      popup-name: ""
      popup-duration: 60
```
