-
Notifications
You must be signed in to change notification settings - Fork 1
Details
Events are represented in the config file as a JSON object. Each event is a distinct key/value pair. The key must be unique, due to the way JSON works, but it is not used outside of error messages, so it should be named descriptively to help with debugging. The value of each event is another JSON object that stores the actual data.
The data object contains two key/value pairs, "conditions" and "actions". The value of both keys is a JSON array containing the condition or action JSON objects, detailed in other sections.
An example of a valid event is given here:
{
"tooclosetothesun": {
"conditions": [
{"type": "playerpos", "dimension": "y", "comparison": ">", "value": 100}
],
"actions": [
{"type": "lightning", "target": "player", "chance": 20}
]
}
}
This event creates a 1 in 20 chance of striking the player with lightning every second while the player's Y position is above 100.
All condition and action objects have a number of arguments that define how the object functions. Only one argument is common to all objects, and that is "type". The value of this must be a string that matches the name of a condition or action, depending on the section. If an unknown type is entered, then an error will be generated in the console, the event that contains the invalid type will not be created, and Minecraft will continue as usual. Giving an "action" type to an object in the "conditions" section or vice versa will generate the same error as entering any other unknown type.