/execute
Công dụng
Khiến Entity thực hiện Command
Đối tượng có thể dùng Command
Player có OP
Chủ Map
Addon
NPC /execute /function /gametest Command BlockCú pháp
/execute <origin: target> <position: x y z> <command: command>
<position: x y z> là tọa độ
<command: command> là Command
/execute Hg ~~~ setblock ~~-1 ~ dirt
Hg sẽ setblock Dirt dữ liệu 0 dưới chân
/execute <origin: target> <position: x y z> detect <detectPos: x y z> <block: Block> <data: int> <command: command>
<position: x y z> là tọa độ
detect là kiểm tra
<detectPos: x y z> là tọa độ kiểm tra
<block: Block> là id Block
<data: int> là dữ liệu Block
<command: command> là Command
/execute Hg ~~~ detect stone 0 setblock ~~-1 ~ dirt
Hg có Stone dữ liệu bằng 0 dưới chân sẽ bị setblock Dirt dữ liệu 0 dưới chân, nếu không có thì không bị setblock Dirt dưới chân
Lưu ý
<position: x y z> nên để mặc định là ~~~ cho mọi /execute Đây chỉ là lời khuyên của Hg
<block: Block> = -1 là mọi loại Block chung id