1- Trigger script allows you to code what a trigger should do when triggered with code.
1+ Trigger script allows you to code what a trigger should do when triggered with code.
22
33## How it works
4+
45Each line is a command with options following it. It is case insensitive.
56
67## Commands
@@ -9,11 +10,11 @@ Each line is a command with options following it. It is case insensitive.
910
1011alter a block's tileId (changing what block it is) or rotate a tile
1112
12- #### Syntax:
13+ #### Syntax
1314
1415` CHANGE <x> <y> BLOCK <tileId> ROTATE <rotation> `
1516
16- #### Options:
17+ #### Options
1718
1819` <x> <y> ` - the position of the block to be altered
1920
@@ -27,27 +28,27 @@ alter a block's tileId (changing what block it is) or rotate a tile
2728
2829teleport to a given position
2930
30- #### Syntax:
31+ #### Syntax
3132
3233` TELEPORT <x> <y> INSTANT `
3334
34- #### Options:
35+ #### Options
3536
3637` <x> <y> ` - where to teleport the player
3738
3839` INSTANT ` - Include to make the teleport instant
3940
40- ---
41+ ---
4142
4243### DELAY
4344
4445wait a specified amount of milliseconds
4546
46- #### Syntax:
47+ #### Syntax
4748
4849` DELAY <ms> `
4950
50- #### Options:
51+ #### Options
5152
5253` <ms> ` - how long to delay in milliseconds
5354
@@ -57,23 +58,23 @@ wait a specified amount of milliseconds
5758
5859fill a selection for ` (x1, y1) ` to ` (x2, y2) `
5960
60- #### Syntax:
61+ #### Syntax
6162
6263` FILL <x1> <y1> <x2> <y2> BLOCK <tileId> `
6364
64- #### Options:
65+ #### Options
6566
6667` <x1> <y1> <x2> <y2> ` - The start and end coordinates of where to fill
6768
6869` BLOCK <tileId> ` - Sets the tileId of the tile fill with
6970
70- ---
71+ ---
7172
7273### IF
7374
7475check whether a statement is true and execute code
7576
76- #### Syntax:
77+ #### Syntax
7778
7879` IF BLOCK <x> <y> IS <property> <value> `
7980
@@ -85,29 +86,40 @@ check whether a statement is true and execute code
8586
8687---
8788
88- ### ELSE
89+ ### ELSE
8990
9091specify what code to run after an if statement if the condition is false
9192
92- #### Syntax:
93+ #### Syntax
9394
9495` ELSE `
9596
96- ---
97+ ---
9798
9899### END
99100
100101specifies the end for an if/else statement
101102
102- #### Syntax:
103+ #### Syntax
103104
104105` END `
105106
106- ---
107+ ---
108+
109+ ### SWAP
110+
111+ Toggles the red and blue blocks on and off
112+
113+ #### Syntax
114+
115+ ` SWAP `
116+
117+ ---
107118
108119## Example Scripts
109120
110121__ Toggles a tile between ground and air__
122+
111123```
112124if block 2 9 is tileid 1 then
113125change 2 9 block 0
@@ -117,23 +129,28 @@ end
117129```
118130
119131__ Teleport to (1, 10)__
132+
120133```
121134teleport 1 10 instant
122135```
123136
124137__ Fills from (1, 4) to (2, 5), waits half a second, then deletes it__
138+
125139```
126140fill 1 4 2 5 block 1
127141delay 500
128142fill 1 4 2 5 block 0
129143```
130144
131145__ Changes block (1, 4) to tileId 4 and rotates it twice__
146+
132147```
133148change 1 4 block 4 rotate 2
134149```
135150
136151__ Changes block (1, 5) to tileId 0 (air)__
152+
137153```
138154change 1 5 block 0
139- ```
155+ ```
156+
0 commit comments