Edit or add a class
Change a class's armour, effects and permission, or add a new class, with every key a class file accepts.
At the end of this page a class of yours exists, or an existing one asks for different armour, a different permission or a different warmup. One class is one .yml file, and there is no menu to build it in.
Before you start#
ExyliaClasses and ExyliaLib are installed and the server has started once, so the six default classes exist. See Install ExyliaClasses. To see a class working first, follow Your first class.
Steps#
Open the class folder
Go to plugins/ExyliaClasses/lang/<language>/classes/. The folder is per language: files ship in en, es, pt, fr, ru and tr, and the names of the class, its abilities and its energy are translated in each. A server that had its files in classes/ before keeps them as lang/custom/classes/, edits included.
Copy or edit a file
To change a class, open its file (Archer.yml). To add one, copy a file and rename it. The file name, lowercased, is the class id: Medic.yml is the class medic.
Set the armour
Under equipment, write the four pieces the class needs (helmet, chestplate, leggings, boots). Only the slots you write are checked. Give each class an armour set no other class uses.
Set who may use it
permission: "NONE" means anyone. Any other value is a permission node a player needs, for example exyliaclasses.class.medic.
Add what the class does
Add passive-effects, then abilities, hold-effects, weapons or energy as you need them. Each has its own guide, linked in the table below.
Reload
Run /classesadmin reload. The reload also checks every online player's armour again against the new files.
A minimal file:
display-name: "<#63ff8a><bold>MEDIC</bold>"
permission: "NONE"
equipment:
helmet: DIAMOND_HELMET
chestplate: DIAMOND_CHESTPLATE
leggings: DIAMOND_LEGGINGS
boots: DIAMOND_BOOTS
passive-effects:
- REGENERATION|1Check that it works#
Put on the full armour. After the warmup (five seconds by default) chat says you are now in the class and the effects appear in your status icons. Take one piece off: chat says you left the class and the effects stop. If nothing happens, check the console for an Invalid material line and read Common problems.
Going further#
Edit in game or on the web#
Anyone with exyliaclasses.admin.settings can also edit each class file in game and in ExyliaLib's web editor (see Edit menus). A class that would lose part of its definition, such as an unknown material, is refused whole instead of saved. The files present at startup are editable; one added later waits for a restart.
Lock a class behind a permission#
permission: "exyliaclasses.class.rogue"A player wearing the armour without the permission gets the no-permission message and no warmup: the armour simply does nothing. The node is yours to invent; the plugin does not register a list of them. The shipped files use exyliaclasses.class.<id>. Anything other than NONE, blank or missing is treated as a real node.
Change the warmup#
warmup:
time: 5
sound:
enabled: true
type: "BLOCK_AMETHYST_BLOCK_PLACE|1|1"
particle:
enabled: true
type: "BUBBLE_POP|100|1.5|1.5|1.5|3"
sound-completed:
enabled: true
type: "BLOCK_PISTON_EXTEND|1|1"
particle-completed:
enabled: true
type: "REVERSE_PORTAL|100|1.5|1.5|1.5|3"
sound-cancel:
enabled: true
type: "BLOCK_ANVIL_PLACE|1|1"
particle-cancel:
enabled: true
type: "DRIP_LAVA|100|1.5|1.5|1.5|3"| Key | Default | When it fires |
|---|---|---|
time | 5 | Seconds. The countdown message is sent once a second. |
sound / particle | off | Every second of the countdown. |
sound-completed / particle-completed | off | The moment the class activates. |
sound-cancel / particle-cancel | off | When the warmup is cancelled by an armour change. |
Each of those six blocks needs enabled: true to do anything; enabled: false or a missing block is silence. Players on a client that supports it also see a cooldown timer for the warmup, drawn with the class's chestplate as its icon, or a compass when the class asks for no chestplate.
The messages are in messages.yml; see Messages and languages. Display names, ability names and mark colours accept the tags in Colours: <#c8c8c8>, <bold>, legacy & codes and palette tokens such as {primary}.
When a class is dropped#
A class is dropped entirely on death and on quit, along with the energy bar and any marks. Ability cooldowns are not reset; see Abilities.
The keys of a class file#
| Key | Default | What it does |
|---|---|---|
display-name | the id | The name in every message, and the answer %exyliaclasses_classes_class% gives a scoreboard or a tab plugin. Colour tags and palette tokens work. |
permission | NONE | The node a player needs. NONE, blank or missing means anyone. |
equipment | none | The armour that puts a player in the class. |
passive-effects | none | Effects held while the class is worn. See Passives. |
special-passives | none | Effects held while a condition holds. See Passives. |
warmup | 5 seconds | The delay before the class activates. |
energy | off | The resource abilities spend. See Energy. |
abilities | none | Right-click items. See Abilities. |
hold-effects | none | Effects while an item is held. See Abilities. |
weapons | none | A mark or backstab weapon. See Weapons. |
The Archer file, trimmed
The shipped Archer also has abilities, warmup sounds and particles; they are left out here to show the smallest working file.
display-name: "<#c8c8c8><bold>ARCHER</bold>"
permission: "exyliaclasses.class.archer"
equipment:
helmet: LEATHER_HELMET
chestplate: LEATHER_CHESTPLATE
leggings: LEATHER_LEGGINGS
boots: LEATHER_BOOTS
passive-effects:
- SPEED|3
- DAMAGE_RESISTANCE|2
special-passives: []
warmup:
time: 5
energy:
enabled: false
abilities: {}
hold-effects: {}
weapons: {}Equipment and how a player gets matched
Only four slots exist: helmet (head), chestplate (chest), leggings (legs) and boots (feet). An unknown material is logged and that slot is ignored, which quietly makes the class easier to enter, so check the console after editing.
Only the material is compared. Enchantments, names, trims, durability and custom data are irrelevant: a Protection IV netherite chestplate and a fresh one are the same chestplate to this plugin.
The armour is re-checked when a player joins (two ticks after the join, so other plugins have given them their gear), when they respawn, whenever an armour piece changes, and for everyone online when the plugin starts or reloads.
- Already in a class: if the armour still fits that class, nothing happens. If it does not, the class is removed and the player is matched again from scratch, so swapping a full leather set for a full gold one goes straight from Archer to a Bard warmup.
- In a warmup: if the armour no longer fits the class being waited on, the warmup is cancelled and the player is matched again.
- Otherwise: the first class whose equipment fits wins, and its warmup starts.
"The first class that fits" is the first in an unordered map, not the first alphabetically or by file name. Two classes asking for the same armour is a coin flip that can land differently after a reload.
Warmup timing
The first countdown message goes out one second after the armour goes on and reads time, and the class activates one second after the message that reads 1. A time: 5 warmup therefore lands six seconds in, and the client-side cooldown timer, which is set to exactly time, empties a second early.
Notation: effects, sounds and particles
Three compact notations run through every class file. All three split on |, so a namespaced key such as minecraft:flame is safe.
Effects, NAME|LEVEL|SECONDS
- SPEED|3 # Speed III, 10 seconds, the default duration
- REGENERATION|2|5 # Regeneration II, 5 seconds
- INVISIBILITY|1|infiniteThe level is what a player reads: SPEED|2 is Speed II. Omit the level for I. Omit the duration for ten seconds. infinite or -1 means it does not expire on its own. passive-effects and special-passives are applied as infinite regardless of what their lines say, because the plugin takes them back itself when the class comes off. A malformed line is skipped rather than failing the file.
Sounds, NAME|VOLUME|PITCH
type: "ENTITY_PLAYER_LEVELUP|1|1.5"Both numbers are optional and default to 1.
Particles, NAME|COUNT|DX|DY|DZ|SPEED
type: "CRIT|60|0.6|0.6|0.6|1"
type: "FLAME|20|0.5" # NAME|COUNT|SPREADThe six-field form gives a spread per axis. The shorter NAME|COUNT|SPREAD|SPEED form is accepted too.
Something missing on this page? Tell us on Discord