Skip to content

nbtCompoundSortKeys

SPGoding edited this page Apr 26, 2020 · 1 revision

Rule Details

⚠️ Diagnostic: this is a diagnostic rule used by the diagnostic feature.

🔧 Fixable: violations of this rule can be fixed by Code Actions.

Whether to sort keys in NBT compounds or not.

  • ("alphabetically"): sorted alphabetically, case-insensitively.
  • ("nbtdoc"): sorted as the same order in nbtdocs. Well, this option hasn't been finished yet.

Examples

Default

{
    "nbtCompoundSortKeys": null
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Glowing: 1b, Invisible: 1b}
summon minecraft:armor_stand ~ ~ ~ {Invisible: 1b, Glowing: 1b}

Alphabetically

{
    "nbtCompoundSortKeys": ["warning", "alphabetically"]
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Glowing: 1b, Invisible: 1b}

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {Invisible: 1b, Glowing: 1b}

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally