Triggers

Triggers are a tool for developers to place in their maps. It starts up by events and finishes by making actions, after meeting the specific conditions.

## Location

Triggers can be located in the developer tool area after you created a map with developer mode.

1. Create a developer mode map.
2. Click the icon in the upper right corner to open the developer tools.
3. Select the trigger category on the left.
4. To add triggers:
	1. Click on the right to create a new trigger.
	2. Add events, conditions, and actions separately.
	3. When you witch to play mode, you can run the trigger.

## Triggers Modules

Triggers has three core modules which are events, conditions and actions. These modules can be set by the player himself. Triggers are executed from left to right and top to bottom, therefore, the order of each triggers is important.

### Trigger Event

Trigger Events are used to identify which specific actions can trigger it.

Examples:

* **When the game is created**
	+ Analysis:
		- You can use this event to do what you want to do when the game is created.
		- When the map exists, this event will only be triggered once when it is created.

* **The block is created**
	+ Analysis:
		- If you want to do some conditions and actions when the block is created, you can use this.
		- This event will be triggered once every block in the map is created.

### Trigger Condition

When an event is triggered, the trigger will execute conditions immediately, which will make the trigger itself execute, only if the conditions are correct.

Examples:

* **When does the game time arrive?**
	+ Analysis:
		- If you want the action to be executed only at 12 o'clock, you can use this to set.
		- When an event is triggered, it happens to be the set game time, the action will be executed.

* **Weather status**
	+ Analysis:
		- It may be sunny when an event is triggered. If you want to do something on a rainy day, you can use this to set.

### Trigger Action

When the event is triggered, the set conditions are correct, and the action will be executed.

Examples:

* **Spawn creatures**
	+ Analysis:
		- Use this action to spawn creatures. As long as the conditions are met when the event is triggered, creatures will be spawned at a certain coordinate.

* **Generate blocks**
	+ Analysis:
		- Generate a block at a certain coordinate. When the event is triggered and the conditions are met, a block will be generated.

## Trigger Interface

### Main Interface

1. New trigger: create a new trigger
2. Check the current trigger: After checking, the current trigger will be executed
3. Trigger menu
4. New trigger group: create a new trigger group, the trigger is included under the trigger group
5. Add event: add the corresponding event
6. Add condition: add the corresponding condition
7. Add action: add the corresponding action
8. Open the debugging information panel: you can open the debugging information panel
9. Debugging switch: if closed, the debugging panel cannot be opened
10. Trigger switch: all triggers will not be executed after closing
11. Input box: you can input by yourself, describe the trigger and other text
12. Trigger variable library: create variables used in triggers
13. The map is switched to the game mode: the map is switched to the game mode, and the trigger will be run at the same time
14. Trigger group menu: the same as the trigger menu
15. Close the trigger interface

### Trigger Menu

1. Can change the name of trigger
2. Adjust trigger sequence
3. Copy the currently selected trigger
4. Move trigger
5. Delete the current trigger

### Rename

1. Enter the name of the trigger to be modified
2. Confirm the name and close the interface
3. Cancel the modification and close the interface

### Rearrange

1. Select “rearrange” in the trigger menu
2. The trigger will display up and down arrow
3. Click the arrows to adjust the order
4. Click OK, and the order adjustment is completed

### Copy

1. Select “Copy” for the trigger
2. A green dot appears next to the trigger group name
3. Click the trigger group entry to copy

### Move

1. Triggers can be moved between trigger group