版本:1.14.4
1.execute的as和at至今没搞懂怎么用
2.如何用execute选定离-3 4 0坐标最近的一个玩家
1.execute的as和at至今没搞懂怎么用
2.如何用execute选定离-3 4 0坐标最近的一个玩家
as就是改变执行者,at就是改变执行位置朝向维度为后面的实体位置
execute positioned -3 4 0 as @p
这个执行位置是-3 4 0,执行者是最近玩家。想要改变执行位置为这个玩家位置,接 at @s
execute positioned -3 4 0 as @p
这个执行位置是-3 4 0,执行者是最近玩家。想要改变执行位置为这个玩家位置,接 at @s
as——以谁执行(不改变位置)
at——以谁的位置执行(不改变执行者)
at——以谁的位置执行(不改变执行者)
所有子命令构成的语法树:
/execute . . .
… align <坐标轴> -> execute
… anchored (eyes|feet) -> execute
… as <实体> -> execute
… at <实体> -> execute
… facing (<坐标>|entity <实体> (eyes|feet)) -> execute
… in <维度> -> execute
… positioned (<坐标>|as <实体>) -> execute
… rotated (<旋转角度>|as <实体>) -> execute
… store (result|success) . . .
… block <坐标> <路径> (byte|short|int|long|float|double) <倍率> -> execute
… bossbar <id> (max|value) -> execute
… entity <实体> <路径> (byte|short|int|long|float|double) <倍率> -> execute
… score <实体> <目标记分项> -> execute
… (if|unless) . . .
… block <坐标> <方块> -> [execute]
… blocks <开始坐标> <结束坐标> <对照区域坐标> (all|masked) -> [execute]
… data . . .
… block <坐标> <路径> -> [execute]
… entity <实体> <路径> -> [execute]
… entity <实体> -> [execute]
… score <实体> <目标记分项> . . .
… (<|<=|=|>|>=) <对照实体> <对照实体记分板项> -> [execute]
… matches <范围> -> [execute]
… run <命令>
…此处-> execute代表的是另一个要执行的子命令的开始
具体每个子命令效果见https://minecraft-zh.gamepedia.com/%E5%91%BD%E4%BB%A4/execute
/execute . . .
… align <坐标轴> -> execute
… anchored (eyes|feet) -> execute
… as <实体> -> execute
… at <实体> -> execute
… facing (<坐标>|entity <实体> (eyes|feet)) -> execute
… in <维度> -> execute
… positioned (<坐标>|as <实体>) -> execute
… rotated (<旋转角度>|as <实体>) -> execute
… store (result|success) . . .
… block <坐标> <路径> (byte|short|int|long|float|double) <倍率> -> execute
… bossbar <id> (max|value) -> execute
… entity <实体> <路径> (byte|short|int|long|float|double) <倍率> -> execute
… score <实体> <目标记分项> -> execute
… (if|unless) . . .
… block <坐标> <方块> -> [execute]
… blocks <开始坐标> <结束坐标> <对照区域坐标> (all|masked) -> [execute]
… data . . .
… block <坐标> <路径> -> [execute]
… entity <实体> <路径> -> [execute]
… entity <实体> -> [execute]
… score <实体> <目标记分项> . . .
… (<|<=|=|>|>=) <对照实体> <对照实体记分板项> -> [execute]
… matches <范围> -> [execute]
… run <命令>
…此处-> execute代表的是另一个要执行的子命令的开始
具体每个子命令效果见https://minecraft-zh.gamepedia.com/%E5%91%BD%E4%BB%A4/execute