data-driven event system
1# Brigadier Commands
2
3Commander introduces a handful of `/` commands. All commands require perm level 2.
4
5## `cmd:arithmetica`
6
7This command allows you evaluate expressions right in the chat. Context: `minecraft:level`, `minecraft:origin` and optional `minecraft:this_entity`. This command requires a string expression and an optional cast.
8
9```
10cmd:arithmetica ->
11 \- expression
12 \- cast (default: none)
13```
14
15Example: `cmd:arithmetica "sin(level.getDayTime)" bool`
16
17## `cmd:explode`
18
19This simple command allows you to spawn explosions. The command tree is as follows:
20
21```
22cmd:explode ->
23 \- entity (who caused the explosion)
24 \- position
25 \- [power] (default: 4)
26 \- [fire] (default: false)
27 \- position
28 \- [power] (default: 4)
29 \- [fire] (default: false)
30```
31
32Example: `cmd:explode @s ~ ~ ~ 6.4 true`
33
34## `cmd:data`
35
36This command allows you to read and write special, persistent data which can later be referenced in expressions. Provided data must be either a number or a string. The command tree is as follows:
37
38::: details Tree
39```
40cmd:data
41 \- read
42 \- level
43 \- key
44 \- chunk
45 \- position
46 \- key
47 \- entity
48 \- entity
49 \- key
50 \- block_entity
51 \- position
52 \- key
53 \- write
54 \- level
55 \- key
56 \- data
57 \- chunk
58 \- position
59 \- key
60 \- data
61 \- entity
62 \- entity
63 \- key
64 \- data
65 \- block_entity
66 \- position
67 \- key
68 \- data
69 \- remove
70 \- level
71 \- key
72 \- chunk
73 \- position
74 \- key
75 \- entity
76 \- entity
77 \- key
78 \- block_entity
79 \- position
80 \- key
81```
82:::
83
84Example: `cmd:data write entity @s "my_test_data" "Hello "`, `cmd:data read entity @s "my_test_data"`, `cmd:data remove entity @s "my_test_data"`
85
86Example reference: `this_entity.storage.my_test_data + 'World!'`