Events file
Every key an event can carry in events.yml, what it does, its default, and what the plugin does when one is written wrongly.
events.yml is the list of events the plugin can pick from. Each event is one block under events, and the key of the block is the event's id, which is what commands use. The file ships with fifteen working events covering all twelve types. Add, edit and delete freely, this file is never touched by an upgrade.
One event
events:
cobble_rush:
enabled: true
weight: 10
type: MINING
display-name: "&b&lStone Rush"
action: "&fBreak the most stone"
duration: 10m
team-mode: INHERIT
targets:
default: 0
STONE: 1
COBBLESTONE: 1
point-rewards:
- type: ITEM
material: DIAMOND
amount: 1
chance: 2.5
rewards:
"1":
commands:
- "eco give %player% 10000"| Key | What it does | Default |
|---|---|---|
enabled | Whether the scheduler can pick this event and /event start can start it. | true |
weight | How often it comes up compared to the others. A share of the total, not a percentage. | 1 |
type | MINING, FARMING, LOGGING, FISHING, ENCHANTING, COMBAT, FARMPOINTS, OBJECTIVE_BREAK, MOB_HUNT, EXCAVATION, BARREL_CLAIM or TARGET_HIT. | required |
display-name | Shown on the board and in every message. Colour codes work. | the id |
action | One short line telling players what to do. | empty |
duration | How long the event runs, written like 10m. | event-defaults.duration |
team-mode | FORCE always makes it a team event, NEVER keeps it solo, INHERIT follows config.yml. | INHERIT |
targets | What counts and how much each is worth. See below. | none |
settings | The optional settings for this type. See Event types. | the type's defaults |
zones | Objective events only. One or more zone names from zones.yml, the first one is where the objectives are placed. | none |
zonePoints | Objective events only. Named points inside the first zone where some types place their objectives. | none |
excludes | Event ids this event cannot directly follow. A manual /event start is refused while one of them is the most recent run event. | none |
objective | Objective events only. The block that holds the type specific settings, its keys are listed per type. | none, required for the five objective types |
point-rewards | Loot rolled once for every whole point a player earns. See Point rewards. | none |
rewards | What each place gets. See Rewards. | none |
targets
One line per block, crop, log, fish or mob, with the points it is worth. default is the value for anything not listed. The shipped mining events set default: 0 so only listed blocks score, and timber_run sets default: 1 so any unlisted log still scores one.
targets:
default: 0
COAL_ORE: 1
DIAMOND_ORE: 15
ANCIENT_DEBRIS: 25Names are Minecraft's own, in capitals with underscores. For a COMBAT event the names are mob names, or the single word HOSTILE with one value to cover every hostile mob. An ENCHANTING or FARMPOINTS event has no targets.
The same values are used in a team event, where every member's points are added into one island total.
What happens when something is wrong
The plugin reads the file at startup and on /event reload, and every problem is reported with the file, the event and the key named. Only the broken part is affected.
| Problem | What happens |
|---|---|
type missing or not one of the twelve | That event is skipped, everything else loads |
| A block, mob, item or enchantment name the running version does not have | That event is skipped, with the name in the warning |
A MINING, FARMING, LOGGING or FISHING event with no targets and default: 0 | That event is skipped, since it could never score |
A COMBAT event with neither HOSTILE nor a mob list | That event is skipped |
An objective event with no objective block, or an objective.total below 1 | That event is skipped |
An objective event that names no zones, or names one that is not in zones.yml | That event is skipped, with the missing zone in the warning |
An objective event with a zonePoints entry that is not a point in its zone | That event is skipped, with the missing point in the warning |
A MOB_HUNT event with no usable entry under objective.mobs | That event is skipped |
An OBJECTIVE_BREAK or TARGET_HIT event whose material or entity does not exist | That event is skipped, with the name in the warning |
An EXCAVATION event whose digMaterial is not suspicious sand or gravel | Corrected to SUSPICIOUS_SAND |
An excludes entry that is not a known event id | That entry is dropped with a note, the rest of the event still loads |
weight below 1 | Corrected to 1 |
duration written wrongly | The default from config.yml is used |
team-mode not one of the three words | INHERIT is used |
A reward key that is not a place, a range or participation | That reward block is skipped |
| A reward block that gives nothing | That reward block is skipped |
A skipped event does not stop the plugin. If every event is skipped, the console says no usable events were found and nothing can start until the file is fixed.
Testing an event
/event list shows every event with its type and whether it is enabled. /event start <id> starts one now. /event start <id> team or solo overrides the team mode for that run, and force ends a running event first. See Commands.
An objective event also needs its zone to exist in zones.yml before it can run. A zone that is missing, or a point it names that is not in that zone, drops the event at load and a warning names the missing part, so make the zone first and the event after it.
While testing on your own, set event-defaults.min-participants to 0 in config.yml or nobody is paid. See Rewards.