Updated Introduction to Editor Scripting.md (markdown)
commited
commit
bffacde5eb6818766c4d4e4bbf39890e9d2643fe
... | ... | @@ -120,11 +120,11 @@ function moveBlock(fromX, fromY, fromZ, toX, toY, toZ) { |
120 | 120 | setBlock(toX, toY, toZ, block); |
121 | 121 | } |
122 | 122 | ``` |
123 | This time, the line starts with a `function` expression, followed by the name of the function we want to create and the name of the inputs the function takes. The code inside the function is run when we run the function just like we would do for built-in ones: |
|
123 | This time, the line starts with a `function` expression, followed by the name of the function we want to create and the name of the inputs the function takes. The code inside the curly brackets is run when we run the function: |
|
124 | 124 | ```js |
125 | 125 | moveBlock(0, 0, 4, 1, 0, 4); |
126 | 126 | ``` |
127 | You will see that this function we have just created moves the block at `(0, 0, 4)` to `(1, 0, 4)`. This way, we can simplify our code by putting common tasks in a block of code that we can later call. |
|
127 | You will see that this function we have just created moves the block at `(0, 0, 4)` to `(1, 0, 4)`. This way, we can simplify our code by putting common tasks in a block of code that we can use later. |
|
128 | 128 | |
129 | 129 | |
130 | 130 | <!-- ToDo: Conditions --> |