# Integrations

SurvivalGames works on its own. If one of these plugins is installed, it is used automatically; nothing has to be turned on.

| Plugin | What it is used for |
| --- | --- |
| [Vault](<https://www.spigotmc.org/resources/vault.34315/>) or [VaultUnlocked](<https://modrinth.com/plugin/vaultunlocked>) + an economy plugin | [money](<#economy>): rewards, bounties, sponsors |
| [PlaceholderAPI](<https://modrinth.com/plugin/placeholderapi>), [MiniPlaceholders](<https://modrinth.com/plugin/miniplaceholders>) | the [placeholders](<https://itsthechris07.github.io/SurvivalGames/placeholders/index.md>) |
| [Parties](<https://modrinth.com/plugin/parties>), [Party and Friends](<https://www.spigotmc.org/resources/party-and-friends-for-spigot.11633/>) | [parties](<#parties>) join and play together |
| [Citizens](<https://citizensnpcs.co/>), [FancyNpcs](<https://modrinth.com/plugin/fancynpcs>) | [join NPCs](<#join-npcs>) |
| [Floodgate](<https://geysermc.org/download#floodgate>) | [Bedrock players](<#bedrock-players>) get forms instead of chest menus |
| [TAB](<https://modrinth.com/plugin/tab-was-taken>) | the tab list, name tags and sidebar of the game aren't overwritten |
| [EssentialsX](<https://essentialsx.net/>) | no god mode, flying, vanish or teleports into games |
| SuperVanish, PremiumVanish, CMI, ... | vanished players aren't put into games |
| [Multiverse-Core](<https://modrinth.com/plugin/multiverse-core>), Multiverse-Inventories | the worlds of games are left alone |
| [EasyPrefix](<https://modrinth.com/plugin/easyprefix-christian34>) and other chat plugins | outside of games they format the chat; in a game the chat shows the team (`chat.format: false` leaves it to them) |

## Discord

A [webhook](<https://support.discord.com/hc/en-us/articles/228383668>) posts what happens in the games to a channel, with no bot and no extra plugin: in the settings of the channel, *Integrations \> Webhooks \> New Webhook*, copy its URL.

```
discord:
  enabled: true
  webhook-url: "https://discord.com/api/webhooks/..."
  # start, win, elimination, varo-day, strike, achievement, season
  events: [ start, win, varo-day, strike, season ]
  games: [ survival-games, varo, uhc ]
  username: ""                      # empty: the name and picture of the webhook
  avatar-url: ""
```

Whoever has the URL can post into the channel; keep it out of `config.yml` with an [environment variable](<https://itsthechris07.github.io/SurvivalGames/configuration/index.md#secrets-in-environment-variables>): `webhook-url: "${SG_DISCORD_WEBHOOK}"`.

The messages are those of the game without colors (`discord_...` in `messages.yml` for the start, the kills and the achievements). Nobody is pinged, also not by a name like `@everyone`. They are sent by an own thread one after another, so a slow Discord doesn't hold up the server.

## Economy

With Vault (or VaultUnlocked) and an economy plugin like EssentialsX:

- **[Rewards](<https://itsthechris07.github.io/SurvivalGames/configuration/index.md#rewards>):** money for kills, wins and games (`rewards.enabled`).
- **[Bounties](<https://itsthechris07.github.io/SurvivalGames/survival-games/index.md#bounties>):** players put money on an enemy, the killer gets it.
- **[Sponsors](<https://itsthechris07.github.io/SurvivalGames/survival-games/index.md#sponsors>):** spectators buy items for the players alive.
- **[Cosmetics](<https://itsthechris07.github.io/SurvivalGames/configuration/index.md#cosmetics>)** and **[achievements](<https://itsthechris07.github.io/SurvivalGames/configuration/index.md#achievements>):** buying effects, money for achievements.

If the economy plugin supports the new API of VaultUnlocked, it is used; otherwise the one of Vault.

## Parties

`parties` in `config.yml`:

- `join-together`: when the leader of a party joins a game (`/sg join`, a join sign or a join NPC), the members on the same server come along, as long as there is room.
- `same-team`: with teams, the members of a party play in the same team: in the team one of them chose, otherwise in a team with room for all of them.

In a [network](<https://itsthechris07.github.io/SurvivalGames/network/index.md>) the party plugin on the proxy takes the members along when the leader is sent to a game server. For Party and Friends install "Spigot Party API for Party and Friends" on the game servers.

## Join NPCs

An NPC of Citizens or FancyNpcs can work like a join sign:

1. Create the NPC with its plugin.
2. `/sg npc link <arena>` (on a lobby server: `<server>`) and click the NPC.

A click on the NPC joins the game (or watches it while it runs). With `npcs.show-status` the NPC shows the state of the game and the players: Citizens in an extra hologram line, FancyNpcs behind the display name. `/sg npc unlink` removes the link, `/sg npc list` lists all join NPCs (saved in `npcs.yml`).

## Bedrock players

Players who join through [Geyser](<https://geysermc.org/>) and Floodgate see the menus of the plugin (teams, kits, map voting, sponsors, settings, ...) as **forms** instead of chest menus, and type numbers into a form.

## TAB

While a player is in a game, TAB doesn't overwrite the name in the tab list, the name tags (team colors) and the sidebar of the game. Everything of TAB comes back when they leave the game.

## EssentialsX

- God mode, vanish and AFK are turned off when a player joins a game; god mode and vanish come back afterwards.
- `/god`, `/fly` and `/vanish` don't work while playing.
- Teleports of Essentials (`/back`, `/tpa`, `/home`, ...) don't lead into the worlds of games.

## Vanish plugins

Vanished players (SuperVanish, PremiumVanish, EssentialsX, CMI, ...) aren't put into games automatically (game server, party members) and can only play once they are visible again.

## Multiverse

- **Multiverse-Core** doesn't import the worlds of the games (`sg_*`, `sgvaro_*`), so it doesn't change the game mode there or load them after a restart.
- **Multiverse-Inventories** doesn't swap the inventories of players who are in a game; the plugin saves and restores them itself.
