# Armor Sets and Custom Weapons An armor set is a group of items with a **bonus**: while the player wears enough pieces of the set, its triggers work, like the triggers of an enchantment. A custom weapon is the same thing with a single piece held in the hand. Each set is a file in `plugins/MetaEnchants/sets/`. The name of the file is the id of the set: `sets/phantom.yml` is the set `phantom`. The plugin comes with two examples: the Phantom armor and the Reaper Scythe. Sets reload with `/metaenchants reload`. Turn them all off in `config.yml`: ```yaml sets: enabled: false ``` ## A set file ```yaml name: "Phantom Set" required: 4 equipped: "You feel the strength of the Phantom set." unequipped: "The Phantom set bonus fades." pieces: helmet: slot: head item: material: NETHERITE_HELMET name: "Phantom Helmet" chestplate: slot: chest item: material: NETHERITE_CHESTPLATE name: "Phantom Chestplate" leggings: slot: legs item: material: NETHERITE_LEGGINGS name: "Phantom Leggings" boots: slot: feet item: material: NETHERITE_BOOTS name: "Phantom Boots" triggers: tough: on: damaged do: - set-damage: "{damage} * 0.9" fast: on: passive do: - effect: type: SPEED duration: 3s level: 1 particles: "false" ``` | Option | Meaning | |---|---| | `name` | The name of the set, used in messages and commands. | | `pieces` | The items of the set. The name of each piece (`helmet`) is its id. | | `required` | How many pieces must be worn for the bonus. All of them by default. | | `equipped` | Message the player reads when the bonus starts. Leave it out for no message. | | `unequipped` | Message the player reads when the bonus ends. | | `triggers` | What the set does. Same as the [triggers of enchantments](Triggers-For-Enchantments). | | `placeholders` | [File placeholders](../File-Placeholders) for the triggers of the set. Each player has their own values. | ### Pieces | Option | Meaning | |---|---| | `slot` | Where the piece must be to count: `head`, `chest`, `legs`, `feet`, `hand` (main hand), `off-hand` or `hands` (either hand). | | `item` | The item. Same format as any item; see [Items](../Items). It can have `enchantments`, also MetaEnchants ones. | A piece only counts in its slot: a Phantom Helmet held in the hand does nothing. Copies of the same piece count once. ## The triggers of a set They use the same events, conditions and actions as enchantments, with these differences: - They only run while the player wears at least `required` pieces. - `{level}` is the number of pieces worn. With `required: 2` in a set of four, the bonus can grow with each piece: `set-damage: "{damage} * (1 - {level} * 0.05)"`. - They belong to the player, not to an item, so the enchantment [souls](Souls-And-Trackers) elements (which need the enchanted item) cannot be used. ## Custom weapons A weapon with its own power is a set with one piece in the hand: ```yaml name: "Reaper Scythe" equipped: "The scythe hungers." pieces: scythe: slot: hand item: material: NETHERITE_HOE name: "Reaper Scythe" enchantments: sharpness: 5 triggers: reap: on: attack if: - entity: [PLAYER] do: - set-damage: "{damage} * 1.2" feast: on: kill do: - heal: amount: 4 entity: "{player}" ``` ## Giving pieces ``` /metaenchants giveset [piece] ``` Without `piece`, the players get every piece of the set. Anywhere an item is accepted ([kits](Kits), the [Enchanter](Enchanter-Tinkerer-Alchemist#the-enchanter), boxes, the `give-item` action), use: ```yaml external-item: "metaenchants:set/phantom/helmet" ``` The pieces are recognized by a mark the plugin puts on them, not by their name or material: renaming a piece in an anvil keeps it in the set, and a plain netherite helmet is never a Phantom Helmet. If you change the `item` of a piece, pieces players already have keep their old look but still count. ## Messages | Message | When | Replaced words | |---|---|---| | `set-unknown` | `giveset` with a set or piece that does not exist. | `%name%` | The `equipped` and `unequipped` texts are written in each set file.