Skip to content

Commit

Permalink
Improve subscription docs
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed Apr 14, 2024
1 parent 8554906 commit 875cb1f
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@ Events in Commander are points during gameplay when your [commands](Commands) wi

## Introduction to subscriptions

An event declaration in your subscription file is an identifier of the event you want to subscribe to. An event can accept additional parameters in the `parameters` block, but built-in events do not require them (yet).
An event declaration in your subscription file is an identifier of the event you want to subscribe to. An event can accept additional parameters in the `parameters` block, but built-in events do not require them (yet). Subscription files are read from `commander/events`.

```
|- recipes
|- commander
|- events
|- test_event.json
|- folder
|- nested.json
|- tags
```

A typical event declaration might look something like this:

::: details Example
```json
{
"event": "commander:after_killed_by_other"
"event": "commander:after_killed_by_other",
"commands": [

]
}
```
<br/>
Expand All @@ -18,7 +33,10 @@ An event declaration in your subscription file is an identifier of the event you
{
"event": "modid:custom_event",
"parameters": {
}
},
"commands": [

]
}
```
:::
Expand Down

0 comments on commit 875cb1f

Please sign in to comment.