# Gamemode Templates

Templates for gamemodes in BattleArena that can be drag-and-dropped into the **arenas** folder.

# One in the Chamber

This is a gamemode that adds one in the chamber to BattleArena. This utilizes the [One in the Chamber](https://docs.bplug.in/books/modules-and-other-tools/page/one-in-the-chamber) module which comes pre-installed with BattleArena.

### Description

- Players spawn with a bow, arrow and a stone sword
- Bows insta-kill a player
- Any time a player scores a kill, they will be given an arrow
- First player to 20 kills wins the game

### Arena Configuration

```yaml
name: OITC
mode: Arena
aliases: [oic, oneinthechamber]
type: Match
team-options:
  named-teams: false
  team-size: 1
  team-amount: 2+
  team-selection: none
modules:
  - duels
  - one-in-the-chamber
  - scoreboards
lives:
  enabled: false
victory-conditions:
  highest-stat:
    stat-name: kills
    win-after: 20
  time-limit:
    time-limit: 5m
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - respawn
    - delay{ticks=1}
    - teleport{location=team_spawn;random=true}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-interact{enabled=false}
  - damage-entities{option=never}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: true
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 60s
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=countdown}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - damage-players{option=other_team}
    events:
      on-start:
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
        - apply-scoreboard{scoreboard=ingame-top-kills}
        - give-item{item=stone_sword}
        - give-item{item=bow}
        - give-item{item=arrow}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}
```

# SkyWars

This is a gamemode that adds SkyWars to BattleArena. This requires the [PhatLoots](https://modrinth.com/plugin/phatloots) plugin for the chest configuration.

### Description

- Players spawn on an island with chests
- Chests contain loot which players loot for items
- Last player standing wins the game

### Configuring Chests

Chests are configured using the [PhatLoots](https://modrinth.com/plugin/phatloots) plugin which contains native support for BattleArena and adds the **reset-loot-tables** action used in the configuration below.

Using PhatLoots, you can create loot tables and link them to blocks (using the **/loot link &lt;loot table&gt;** command). The [following configurations](https://gist.github.com/Redned235/845f736c2b64a2bf930bf76929f44ef8) are provided as island and center loot tables, and can be placed inside the **plugins/PhatLoots/LootTables** directory. Then, using PhatLoots, you can link these to chest blocks by running **/loot link island** and **/loot link center** for island and center chests respectively.

### Arena Configuration

```yaml
name: SkyWars
mode: Arena
type: Match
team-options:
  named-teams: false
  team-size: 1
  team-amount: 2+
  team-selection: none
modules:
  - duels
  - scoreboards
lives:
  enabled: false
victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - clear-effects
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - clear-inventory
    - respawn
    - delay{ticks=1}
    - teleport{location=waitroom}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-interact{enabled=false}
  - damage-entities{option=never}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
  - shuffle-loot{enabled=true}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: true
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 60s
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=countdown}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - damage-players{option=other_team}
      - block-break{enabled=true}
      - block-place{enabled=true}
      - block-interact{enabled=true}
    events:
      on-start:
        - change-gamemode{gamemode=survival}
        - reset-loot-tables
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
        - apply-scoreboard{scoreboard=ingame-list}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}

```

# Survival Games

This is a gamemode that adds Survival Games to BattleArena. This requires the [PhatLoots](https://modrinth.com/plugin/phatloots) plugin for the chest configuration.

### Description

- Players spawn in a map with chests
- Chests contain loot which players loot for items
- Last player standing wins the game

### Configuring Chests

Chests are configured using the [PhatLoots](https://modrinth.com/plugin/phatloots) plugin which contains native support for BattleArena and adds the **reset-loot-tables** action used in the configuration below.

Using PhatLoots, you can create loot tables and link them to blocks (using the **/loot link &lt;loot table&gt;** command). The [following configurations](https://gist.github.com/Redned235/331e576c4c7928efe95982bc6d1c9561) are provided as standard and pedestal loot tables, and can be placed inside the **plugins/PhatLoots/LootTables** directory. Then, using PhatLoots, you can link these to chest blocks by running **/loot link standard** and **/loot link pedestal** for standard and pedetal chests respectively.

### Arena Configuration

```yaml
name: SurvivalGames
aliases: [sg]
mode: Arena
type: Match
team-options:
  named-teams: false
  team-size: 1
  team-amount: 2+
  team-selection: none
modules:
  - arena-restoration
  - duels
  - scoreboards
lives:
  enabled: false
victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - clear-effects
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - clear-inventory
    - respawn
    - delay{ticks=1}
    - teleport{location=waitroom}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-interact{enabled=false}
  - damage-entities{option=never}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
  - shuffle-loot{enabled=true}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: true
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 60s
    options:
      - damage-players{option=never}
    events:
      on-start:
        - apply-scoreboard{scoreboard=countdown}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - damage-players{option=other_team}
      - block-place{enabled=true}
      - block-interact{enabled=true}
    events:
      on-start:
        - change-gamemode{gamemode=survival}
        - reset-loot-tables
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
        - apply-scoreboard{scoreboard=ingame-list}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
        - restore-arena
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}

```

# Bow Spleef

This is a gamemode that adds Bow Spleef to BattleArena. This requires [ArenaSpelef](https://modrinth.com/plugin/arenaspleef) to be installed.

### Description

- A spin on the classic spleef mode, where instead of having to break blocks with a shovel, TNT is broken with a flame bow
- Last player alive wins

### Arena Configuration

```yaml
name: BowSpleef
mode: Spleef
type: Match
team-options:
  named-teams: false
  team-size: 1
  team-amount: 2+
  team-selection: none
modules:
  - scoreboards
lives:
  enabled: false
victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m
layer-decay-delay: 2m
layer-decay-time: 1m
game: bow_spleef
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - clear-effects
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - clear-inventory
    - respawn
    - delay{ticks=1}
    - change-gamemode{gamemode=adventure}
    - teleport{location=waitroom}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-drops{enabled=false}
  - block-interact{enabled=false}
  - item-drops{enabled=false}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
  - damage-entities{option=never}
  - damage-players{option=never}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: false
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 5s
    events:
      on-start:
        - paste-layers
        - apply-scoreboard{scoreboard=countdown}
      on-complete:
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - block-interact{enabled=true}
    events:
      on-start:
        - give-shovel{shovel=bow}
        - give-item{item=arrow}
        - change-gamemode{gamemode=survival}
        - apply-scoreboard{scoreboard=ingame-list-alive}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}
```

# Splegg

This is a gamemode that adds Splegg to BattleArena. This requires [ArenaSpelef](https://modrinth.com/plugin/arenaspleef) to be installed.

### Description

- A spin on the classic spleef mode, where instead of having to break blocks with a shovel, you get an egg cannon which you shoot to break blocks
- Last player alive wins

### Arena Configuration

```yaml
name: Splegg
mode: Spleef
type: Match
team-options:
  named-teams: false
  team-size: 1+
  team-amount: 2
  team-selection: none
modules:
  - scoreboards
lives:
  enabled: false
victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m
layer-decay-delay: 2m
layer-decay-time: 1m
game: splegg
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - clear-effects
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - clear-inventory
    - respawn
    - delay{ticks=1}
    - change-gamemode{gamemode=adventure}
    - teleport{location=waitroom}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-drops{enabled=false}
  - block-interact{enabled=false}
  - item-drops{enabled=false}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
  - damage-entities{option=never}
  - damage-players{option=never}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: false
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 5s
    events:
      on-start:
        - paste-layers
        - apply-scoreboard{scoreboard=countdown}
      on-complete:
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - block-interact{enabled=true}
    events:
      on-start:
        - change-gamemode{gamemode=survival}
        - give-shovel{shovel=egg-cannon}
        - apply-scoreboard{scoreboard=ingame-list-alive}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}
```

# TNT Run (Decay Spleef)

This is a gamemode that adds TNT Run to BattleArena. This requires [ArenaSpelef](https://modrinth.com/plugin/arenaspleef) to be installed.

### Description

- A spin on the classic spleef mode, where blocks break beneath you as you walk on them.
- Last player alive wins

### Arena Configuration

```yaml
name: TNTRun
mode: Spleef
type: Match
team-options:
  named-teams: false
  team-size: 1
  team-amount: 2+
  team-selection: none
modules:
  - scoreboards
lives:
  enabled: false
victory-conditions:
  teams-alive:
    amount: 1
  time-limit:
    time-limit: 5m
layer-decay-delay: 2m
layer-decay-time: 1m
game: decay
events:
  on-join:
    - store{types=all}
    - change-gamemode{gamemode=adventure}
    - flight{enabled=false}
    - teleport{location=waitroom}
  on-spectate:
    - store{types=all}
    - change-gamemode{gamemode=spectator}
    - flight{enabled=true}
    - teleport{location=spectator}
  on-leave:
    - clear-effects
    - restore{types=all}
    - remove-scoreboard
  on-death:
    - clear-inventory
    - respawn
    - delay{ticks=1}
    - change-gamemode{gamemode=adventure}
    - teleport{location=waitroom}
options:
  - block-break{enabled=false}
  - block-place{enabled=false}
  - block-drops{enabled=false}
  - block-interact{enabled=false}
  - item-drops{enabled=false}
  - keep-inventory{enabled=true}
  - keep-experience{enabled=true}
  - damage-entities{option=never}
  - damage-players{option=never}
initial-phase: waiting
phases:
  waiting:
    allow-join: true
    next-phase: countdown
    events:
      on-start:
        - apply-scoreboard{scoreboard=waiting}
      on-join:
        - apply-scoreboard{scoreboard=waiting}
  countdown:
    allow-join: false
    allow-spectate: true
    revert-phase: true
    next-phase: ingame
    countdown-time: 5s
    events:
      on-start:
        - paste-layers
        - apply-scoreboard{scoreboard=countdown}
      on-complete:
        - teleport{location=team_spawn}
        - play-sound{sound=block.note_block.pling;pitch=2;volume=1}
  ingame:
    allow-join: false
    allow-spectate: true
    next-phase: victory
    options:
      - block-interact{enabled=true}
    events:
      on-start:
        - change-gamemode{gamemode=survival}
        - apply-scoreboard{scoreboard=ingame-list-alive}
  victory:
    allow-join: false
    allow-spectate: false
    next-phase: waiting
    duration: 5s
    events:
      on-complete:
        - leave
        - remove-scoreboard
      on-victory:
        - send-message{message=<green>Congrats, you won!</green>}
        - play-sound{sound=entity.player.levelup;pitch=1;volume=1}
      on-lose:
        - send-message{message=<red>Sorry, you lost!</red>}
        - play-sound{sound=block.anvil.place;pitch=0;volume=1}
      on-draw:
        - send-message{message=<yellow>It's a draw!</yellow>}
        - play-sound{sound=block.beacon.deactivate;pitch=0;volume=1}
```