Your First Event
Create an event for 10 to 12 July that sends a chat message at its start and end and runs a console command at its start. The guide has five steps.
What you need
- MythicSeasons installed and started once, and the
mythicseasons.adminpermission (operators have it). enabled: trueandsync-time-with-real-world: falseincalendar.yml, the defaults.- A world with a season.
/ms set summerin the world gives it one.
Paths are relative to plugins/MythicSeasons.
Step 1: Copy the example file
Copy events/example.yml to events/harvest.yml. The id inside names the event, not the file name.
Step 2: Edit the copy
Replace the content of events/harvest.yml with this:
enabled: true
id: harvest
display-name: "<gold>Harvest Festival"
display-event: true
type: dated
schedule:
start: 10/7
stop: 12/7
disabled-worlds:
- NONE
commands:
start:
- "<gold>The Harvest Festival <green>has started!"
- "/say The Harvest Festival has started in %world%."
stop:
- "<gray>The Harvest Festival is over."
scheduledates areday/month, so the event is active on 10, 11 and 12 July and stops on 13 July. Withamerican-date-format: trueincalendar.yml, writemonth/dayhere andmonth/day/yearin/ms setdate.- In
commands, lines starting with/run from the console,NONEdoes nothing and other lines go to every player in the world as chat.%world%,%season%,%day%,%month%,%month_asname%,%year%and%weekday%are filled in. Quote every line: one that begins with%is not valid YAML unless quoted. - The isevent condition uses the
id(isevent{e=harvest}), and MythicMobs mobs get the signalsstartEvent_harvestandendEvent_harvest. display-event: falseruns an event without announcing it.disabled-worldslists worlds where it does not run, andNONEmatches no world.typecan also beweeklyordaily, see Events.
Step 3: Reload
Run:
/ms reload
The console lists every event it loads, including:
Loaded event: harvest
If that line is missing, check the console:
| Console line | Cause |
|---|---|
| None, and no warning either | enabled is still false. A disabled event is skipped without a message |
Event file harvest.yml has no 'id' field, skipping. |
No id line, or a YAML error (printed above this line) |
events/harvest.yml is a dated event but has no schedule.start and schedule.stop, skipping it. |
A date is missing |
events/harvest.yml schedule.start '<start>' / schedule.stop '<stop>': dates must be day/month, day/month/year or a plain day number. Skipping this event. |
A date is not written with numbers |
Step 4: Start the event
An event starts when a world's date moves into its schedule from a day outside it. Run these in the world, one after the other (day/month/year):
/ms setdate 9/7/0
/ms setdate 10/7/0
Each prints the date it sets:
Date set to 9/7/0
Date set to 10/7/0
Players in the world get The Harvest Festival has started!, and the server broadcasts The Harvest Festival has started in <world>. /ms getinfo now shows:
Events: Harvest Festival
While automatic-season-cycling is true (the default), /ms setdate also moves the world to the season of its new date.
Step 5: Stop the event
Move the date past the last day of the event:
/ms setdate 13/7/0
The command prints Date set to 13/7/0, players in the world get The Harvest Festival is over. and /ms getinfo reads:
Events: -
/ms set summer moves the world back to the middle of summer.
Good to know
- A world in
worlds-without-eventsincalendar.ymlruns no start or stop lines, but the event still counts as active there. /ms event start harvestand/ms event stop harveststart and stop the event by hand and run its lines, answeringEvent harvest: onandEvent harvest: off. A hand start lasts until you stop it, its schedule ends it,/ms reloador a restart.
Next steps
- Events and Event Options cover every event type and key.
- IsEvent and Event Skills show skills that react to events.
- Calendar covers months, weekdays and the date format.