From 38119727e7e9dc0a8083e43ca86fa8bfe455743c Mon Sep 17 00:00:00 2001 From: Xterionix <72647213+Xterionix@users.noreply.github.com> Date: Sat, 21 Oct 2023 03:29:50 +0500 Subject: [PATCH] - New /execute syntax --- .../auto_completions/function/general.json | 154 +++++++++++++++++- packages/auto_completions/function/main.json | 29 ++-- packages/auto_completions/general.json | 5 + 3 files changed, 177 insertions(+), 11 deletions(-) diff --git a/packages/auto_completions/function/general.json b/packages/auto_completions/function/general.json index 2964dfe..7ea320d 100644 --- a/packages/auto_completions/function/general.json +++ b/packages/auto_completions/function/general.json @@ -182,5 +182,157 @@ "recipe_options": [ "give", "take" - ] + ], + "axes": [ + "x", + "y", + "z", + "xy", + "xz", + "yz", + "xyz" + ], + "anchors": [ + "eyes", + "feet" + ], + "scan_mode": [ + "masked", + "all" + ], + "score_compare_operators": [ + "<", + "<=", + "=", + ">", + ">=" + ], + "execute_subcommands": { + "align": { + "$function.general.axes": { + "$load": "$function.general.execute_subcommands" + } + }, + "anchored": { + "$function.general.anchors": { + "$load": "$function.general.execute_subcommands" + } + }, + "as": { + "$function.general.target_selector": { + "$load": "$function.general.execute_subcommands" + } + }, + "at": { + "$function.general.target_selector": { + "$load": "$function.general.execute_subcommands" + } + }, + "facing": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$load": "$function.general.execute_subcommands" + } + } + }, + "entity": { + "$function.general.target_selector": { + "$function.general.anchors": { + "$load": "$function.general.execute_subcommands" + } + } + } + }, + "if": { + "block": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.block_identifier": { + "$load": "$function.general.execute_subcommands" + } + } + } + } + }, + "blocks": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$function.general.scan_mode": { + "$load": "$function.general.execute_subcommands" + } + } + } + } + } + } + } + } + } + } + }, + "entity": { + "$function.general.target_selector": { + "$load": "$function.general.execute_subcommands" + } + }, + "score": { + "$function.general.target_selector": { + "$general.translatable_text": { + "$function.general.score_compare_operators": { + "$function.general.target_selector": { + "$general.translatable_text": { + "$load": "$function.general.execute_subcommands" + } + } + }, + "matches": { + "$general.number": { + "$load": "$function.general.execute_subcommands" + } + } + } + } + } + }, + "in": { + "$general.dimensions": { + "$load": "$function.general.execute_subcommands" + } + }, + "positioned": { + "$function.general.location": { + "$function.general.location": { + "$function.general.location": { + "$load": "$function.general.execute_subcommands" + } + } + }, + "as": { + "$load": "$function.general.execute_subcommands.as" + } + }, + "rotated": { + "$general.number": { + "$general.number": { + "$load": "$function.general.execute_subcommands" + } + }, + "as": { + "$load": "$function.general.execute_subcommands.as" + } + }, + "run": "$function.main", + "unless": { + "$load": "$function.general.execute_subcommands.if" + } + } } \ No newline at end of file diff --git a/packages/auto_completions/function/main.json b/packages/auto_completions/function/main.json index ab1df17..66e9800 100644 --- a/packages/auto_completions/function/main.json +++ b/packages/auto_completions/function/main.json @@ -162,18 +162,23 @@ "$general.enchantment_name": "$general.number" } }, - "execute": { - "$function.general.target_selector": { - "$function.general.location": { - "$function.general.location": { + "$versioned_template.execute": [ + { + "$if": "$project_target_version < 1.19.50", + "$data": { + "$function.general.target_selector": { "$function.general.location": { - "$load": "$function.main", - "detect": { + "$function.general.location": { "$function.general.location": { - "$function.general.location": { + "$load": "$function.main", + "detect": { "$function.general.location": { - "$function.general.block_identifier": { - "$general.number": "$function.main" + "$function.general.location": { + "$function.general.location": { + "$function.general.block_identifier": { + "$general.number": "$function.main" + } + } } } } @@ -182,8 +187,12 @@ } } } + }, + { + "$if": "$project_target_version >= 1.19.50", + "$data": "$function.general.execute_subcommands" } - }, + ], "fill": { "$function.general.location": { "$function.general.location": { diff --git a/packages/auto_completions/general.json b/packages/auto_completions/general.json index 06a79f1..3897f66 100644 --- a/packages/auto_completions/general.json +++ b/packages/auto_completions/general.json @@ -855,6 +855,11 @@ "peaceful", "p" ], + "dimensions": [ + "nether", + "overworld", + "the_end" + ], "gamemode": [ "adventure", "creative",