Kits
Saving kits from your inventory, editing them, the kit file, and the kit picker and preview menus.
Kits are saved straight from your own inventory, so building one is as simple as filling your inventory and running one command. Everything on the items is kept: enchantments, names, lore, custom model data, attributes and items from other plugins such as ItemsAdder.
Creating a kit
Fill your inventory
Put the kit items in your inventory, armour slots and offhand, exactly where players should get them.
Save it
/duel kit create <name>Kit names use lower case letters, digits, - and _. The kit is saved to kits/<name>.yml and shows up in the kit picker straight away.
Dress it up
Hold an item and run /duel kit seticon <name> to use it as the icon, and /duel kit rename <name> <display name> to set a MiniMessage display name. Lore, order and the rules below are edited in the kit file, then applied with /duel admin reload.
Kit commands
All need zrivalsduels.admin.kit. Everything except list must be run in game.
| Command | What it does |
|---|---|
/duel kit create <name> | Save your inventory, armour and offhand as a new kit |
/duel kit update <name> | Replace the kit's items with your inventory. Display settings are kept |
/duel kit delete <name> | Delete a kit. Asks you to run the confirm command shown in chat within 30 seconds |
/duel kit load <name> | Put the kit into your inventory to edit it. Your own inventory is saved first |
/duel kit restore | Give back the inventory saved by kit load |
/duel kit seticon <name> | Use the item in your main hand as the kit icon |
/duel kit rename <name> <display name> | Set the display name, MiniMessage format |
/duel kit preview <name> | Open the read only preview menu |
/duel kit list | List every kit with its ranked and permission settings. Click a line to preview |
To edit a kit: /duel kit load <name>, change the items, /duel kit update <name>, then /duel kit restore to get your own inventory back.
If you delete a kit that a setup menu has selected, the selection is cleared and both players are told.
The kit file
# Name shown in menus and messages, MiniMessage format
display-name: "<gold>Example"
# Lines shown under the kit name in the kit picker, MiniMessage format
lore:
- "<gray>A simple starter kit."
# Icon material in the kit picker, used when icon-item is empty
icon: IRON_SWORD
# Saved icon item, set in game with the kit seticon command, leave empty to use the icon material
icon-item: ""
# Position in the kit picker, lower numbers come first
order: 0
# When true only players with zrivalsduels.kit.<kit name> can pick this kit
permission-required: false
# Allow this kit in ranked duels
ranked-allowed: true
# Rules that apply while this kit is used
settings:
no-hunger: false
regeneration: true
allow-block-place: false
allow-block-break: false
max-health: 20.0
# Effects given when the duel starts
potion-effects: []| Key | What it does | Default |
|---|---|---|
display-name | Name in menus and messages | <gold> plus the kit name |
lore | Lines under the name in the kit picker | empty |
icon | Icon material, used when icon-item is empty | IRON_SWORD |
icon-item | A saved icon item, written by /duel kit seticon. Do not edit by hand | empty |
order | Position in the picker, lower first. Ties sort by name | 0 |
permission-required | When true, only players with zrivalsduels.kit.<name> see and use it | false |
ranked-allowed | Whether the kit can be used in ranked duels | true |
settings.no-hunger | Keep the hunger bar from dropping | false |
settings.regeneration | Natural health regeneration from a full hunger bar. false turns it off | true |
settings.allow-block-place | Let players place blocks, only inside the arena's combat region | false |
settings.allow-block-break | Let players break blocks, only inside the arena's combat region | false |
settings.max-health | Maximum health during the duel. 20.0 is ten hearts | 20.0 |
potion-effects | Effects given when the fight begins, see below | empty |
items | The saved items. Written by create and update, do not edit by hand |
Potion effects
Each entry has an effect (the Minecraft effect name), an amplifier (0 is level 1) and duration-seconds (-1 lasts the whole duel):
potion-effects:
- effect: speed
amplifier: 0
duration-seconds: -1
- effect: strength
amplifier: 1
duration-seconds: 30An unknown effect name is skipped with a console warning.
The example kit
The shipped example kit has no saved items. Instead it has a starter-items list that gives an iron sword, a bow, food, arrows and iron armour, so the kit menu works on a fresh install. The first /duel kit update example replaces the starter items with your saved inventory. Kit files you create yourself never use starter-items.
Own gear
own-gear is a reserved kit name. It is the built in choice for duels where players fight with their own items, set by the Gear button in the setup menu and the own-gear section of config.yml. It is never listed in the kit picker or the queue, and /duel kit create own-gear is refused. Add own-gear to an arena's allowed-kits list to allow it in an arena that limits kits.
The kit picker
Opened from the kit button in the setup menu. It shows only kits both players can use, and in ranked only kits with ranked-allowed: true.
- Left click selects a kit.
- Right click opens the preview, closing it returns to the picker.
The layout is in menus/kit-select.yml and the preview in menus/kit-preview.yml, see Menus.
Kit items are always found
Every item a kit gives is tagged with the id of the duel. When the duel ends, every tagged item is removed before the player's own inventory goes back. When a player joins, their inventory and ender chest are scanned and any leftover duel item is removed. Dropped duel items cannot be picked up by anyone outside that duel.