SHOW:
|
|
- or go back to the newest paste.
1 | say this is a minecraft command which will run once when you load the structure! | |
2 | say you can put any minecraft commands here at all, such as: | |
3 | gamerule commandBlockOutput false | |
4 | ||
5 | //you can write a comment which will be ignored by placing two forward slashes | |
6 | //you can also leave empty lines without generating blank commands | |
7 | ||
8 | //here is how you do a repeating clock: | |
9 | machine mugs_clock every 1 | |
10 | say all commands tab indented here will be part of a clock called "mugs_clock" | |
11 | say it will run every tick (20/second) //you can change the number after "every" to slow the clock down | |
12 | ||
13 | machine commands_that_runs_when_called | |
14 | say this machine will only run when told to by a command, rather than at regular intervals | |
15 | ||
16 | run commands_that_runs_when_called //this will make it run. You can put this command inside other clocks. | |
17 | run commands_that_runs_when_called after 20 //this will wait a second before running it | |
18 | ||
19 | - | //note that "run"ing a command more than once in a frame. |
19 | + | //note that "run"ing a command more than once in a frame wont make the commands execute again. |
20 | //to avoid that use "inline": | |
21 | ||
22 | inline some_random_code | |
23 | say this code isnt part of its own machine | |
24 | say instead, whenever you type its name in the future it will be *inserted* into that point in your code | |
25 | say for example: | |
26 | ||
27 | machine another_machine every 1 | |
28 | some_random_code | |
29 | some_random_code | |
30 | //this machine will have all three commands from "some_random_code" inserted into it twice | |
31 | //so we will be adding 6 command blocks instead of just 1 | |
32 | //but it allows the code to be run multiple times in a frame | |
33 | ||
34 | alias mugs_alias this is an alias! | |
35 | //now whenever i type "mugs_alias", it will replace that with "this is an alias" | |
36 | //you could use that like so: | |
37 | ||
38 | say mugs_alias //translates to "say this is an alias!" | |
39 | ||
40 | //I often use it for this: | |
41 | alias so+ scoreboard objectives add | |
42 | alias sp+ scoreboard players add | |
43 | //etc... | |
44 | //careful that you dont make your aliases too short or you might accidentally use them when you dont want to! | |
45 | ||
46 | //you can also use inlines kind of like functions in programming, effectively building temporary aliases into them: | |
47 | ||
48 | inline kill_near <x> <y> <z> <r> | |
49 | execute @p <x> <y> <z> kill @e[r=<r>] | |
50 | say killing all entities within <r> blocks of <x> <y> <z>! | |
51 | ||
52 | //now I can use it like so: | |
53 | kill_near 100 50 100 10 | |
54 | //which effectively translates to "execute @p 100 50 100 kill @e[r=10]" | |
55 | //and "say killing all entities within 10 blocks of 100 50 100!" | |
56 | ||
57 | //if you want to run many similar commands you can use a prefix: | |
58 | prefix execute @e[c=1,type=zombie] ~ ~ ~ say | |
59 | all this indented text | |
60 | will be said by a zombie! | |
61 | grr im a zombie lol... | |
62 | ||
63 | //you can even use a prefix within an inline, machine or even another prefix: | |
64 | prefix tell | |
65 | prefix mug806 | |
66 | only mug806 can read this message | |
67 | and this message | |
68 | prefix @p | |
69 | these messages will be whispered | |
70 | to the nearest player |