Minecraft Java コマンド備忘録
注意
[player]はフェイクプレイヤーで構わない
[player],[object]などの[]は実際には含めない
[facing=north],[powered=true]などの[]は含める
[]
[player] プレイヤー
[entity] エンティティ
[object] スコアボードオブジェクト
[tag] タグ名
[pos] 座標
[scope] 範囲
[command] コマンド
プレイヤー関係
プレイヤーの数をカウントする
execute store result score [player] [object] if entity [entity]
エンティティ関連
実行者と同じ方向を向かせる
#実行者と同じ位置の場合
summon [entity] ~ ~ ~
data modify [entity] @e[type=armor_stand,distance=..0.01,limit=1] Rotation set from entity @s Rotation
#実行者と違う位置の場合
summon armor_stand ~ ~ ~ {Tags:["[tag]"]}
data modify entity @e[type=armor_stand,tag=[tag],limit=1] Rotation set from entity @s Rotation
検出関係
範囲内に特定のブロックが存在する
execute store success score [player] [object] run fill [scope] [block] replace [block]
execute if score [player] [object] matches 1.. run [command]
ボタンを押したことを一瞬検知する
execute unless score [player] [object] matches 1.. if block [pos] [block][powered=true] run [command]
execute unless score [player] [object] matches 1.. if block [pos] [block][powered=true] run scoreboard players set [player] [object] 1
execute if block [pos] [block][powered=false] run scoreboard players reset [player] [object]
書見台にある本を読み終えたことを検知する
#最初のページは{Page:0}として管理されている
execute if data block -35 25 42 {Page:[最後のページ+1]}
この記事が気に入ったらサポートをしてみませんか?