Skip to content

Details

Daedalus1400 edited this page May 20, 2017 · 8 revisions

Events

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.

Types

All objects, condition, action, and generic, 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 literal string that matches the name of a condition, action, or generic, depending on the location. 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. Types are specific to the object being represented. For example: a "type" of "playerpos" (a condition) will cause en error if given when the system is expecting an action or generic.

Clone this wiki locally