selectorSortKeys - ChenCMD/datapack-helper-plus-JP GitHub Wiki

ルールの詳細

⚠️ Diagnostic: これは、校閲機能によって使用される校閲ルールです。

🔧 Fixable: これは、校閲機能によって使用される校閲ルールです。

セレクターの引数の順番を強制するかどうか。

  • (string[]): 特定の順序でソートされます。 Negで終わる値は、その型の否定的なバージョンです。 例えば、typetype=xxxを表し、typeNegtype=!xxxを表します。

    設定で指定可能な全てのキーが指定されていることを確認してください。指定されていない場合は、コードアクションを実行します。

Default

{
    "selectorSortKeys": null
}

👍 良い例

kill @e[type=minecraft:zombie, tag=foo]
kill @e[tag=foo, type=minecraft:zombie]

パフォーマンス

これは、部分的にvdvman1氏の研究にも基づいています。 https://minecraftcommands.github.io/commanders-handbook/selector-argument-order.

{
    "selectorSortKeys": [
        "warning",
        [
            "sort", "limit",
            "type", "gamemode", "gamemodeNeg", "level", "team", "teamNeg",
            "typeNeg", "tag", "tagNeg", "name", "nameNeg", "predicate", "predicateNeg",
            "scores", "advancements", "nbt", "nbtNeg",
            "x", "y", "z", "dx", "dy", "dz", "distance", "x_rotation", "y_rotation"
        ]
    ]
}

👍 良い例

kill @e[type=minecraft:zombie, tag=foo]

👎 悪い例

kill @e[tag=foo, type=minecraft:zombie]

History

このルールはDHP 2.0.0で実装されました。

⚠️ **GitHub.com Fallback** ⚠️