网易我的世界吧 关注:18,643贴子:99,639
  • 4回复贴,共1

1.19的execute你学废了吗

只看楼主收藏回复

undefined
可以限制在指定方块被检测到时才执行命令:
execute <origin: target> <position: x y z> detect <detectPos: x y z> <block: Block> <data: int> <command: command>
新语法树状图
/execute ...
… align <axes: string> <chainedCommand: ExecuteChainedOption_0>
… anchored <eyes|feet> <chainedCommand: ExecuteChainedOption_0>
… as <origin: target> <chainedCommand: ExecuteChainedOption_0>
… at <origin: target> <chainedCommand: ExecuteChainedOption_0>
… facing ...
… <position: x y z> <chainedCommand: ExecuteChainedOption_0>
… entity <origin: target> <eyes|feet> <chainedCommand: ExecuteChainedOption_0>
… in <dimension: Dimension> <chainedCommand: ExecuteChainedOption_0>
… positioned ...
… <position: x y z> <chainedCommand: ExecuteChainedOption_0>
… as <origin: target> <chainedCommand: ExecuteChainedOption_0>
… rotated ...
… <yaw: value> <pitch: value> <chainedCommand: ExecuteChainedOption_0>
… as <origin: target> <chainedCommand: ExecuteChainedOption_0>
… run <command: command>
… <subcommand: Option_If_Unless> ...
… block <position: x y z> <block: Block> ... [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… <blockStates: block states> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… <data: int> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… blocks <begin: x y z> <end: x y z> <destination: x y z> <scan mode: BlocksScanMode> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… entity <target: target> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… score <target: target> <objective: string> ...
… <operation: compare operator> <source: target> <objective: string> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]
… matches <range: integer range> [lbk]chainedCommand: ExecuteChainedOption_0[rbk]


IP属地:浙江来自Android客户端1楼2023-12-10 10:23回复
    参数
    origin: target
    指定目标命令执行者。必须为一个玩家名或目标选择器。若多个目标被选中,则每个目标各运行一次指定的命令。
    position: x y z
    指定命令运行的位置。x和z必须在-30,000,000到30,000,000内(含)。使用波浪号指定的相对坐标的参考点为命令代行者所处位置,而非此命令的执行位置。
    command: command
    指定要运行的命令。必须为一个有效命令。
    detectPos: x y z
    指定要检测方块的位置。x和z必须在-30,000,000到30,000,000内(含)。可使用波浪号来指定与position: x y z的相对坐标。
    block: Block(仅在detect模式可用)
    指定方块ID,必须与detectPos: x y z处的方块相同,命令才会执行。block: Block必须是有效的方块ID或方块名(例如,minecraft:stone)。
    data: int(仅在detect模式可用)
    必须与测试方块的方块数据相等,命令才会执行。设为-1可匹配任意的方块数据。
    效果
    若参数指定不正确,或origin: target无法解析为一个或多个有效实体(指定名字的玩家必须在线),或检测到的方块ID、数据或状态不匹配,或指定的命令执行失败则失败。
    若成功,指定的命令将在指定的坐标位置,使用管理员等级的权限,以目标的身份执行。
    具体操作流程:
    origin
    把将要运行的命令的执行者、执行位置、执行朝向、执行维度改为目标实体、目标实体的位置、朝向、维度。
    position
    修饰将要运行的命令的执行位置。
    detectPos block data
    根据将要运行的命令的执行位置、执行朝向,和execute命令的执行维度检测指定位置的方块是否为给定方块ID及数据。
    command
    若使用第一种语法或检测到的方块符合条件,则执行将要运行的命令。


    IP属地:浙江来自Android客户端2楼2023-12-10 10:23
    回复
      气死,网易1.18


      IP属地:广东3楼2024-02-17 09:56
      收起回复