Skip to content

selectorBracketSpacing

SPGoding edited this page Apr 26, 2020 · 1 revision

Rule Details

🎨 Stylistic: this is a stylistic rule used by the formatting feature.

Enforce spacing inside the square brackets of entity selectors.

  • (object) Root.
    • inside: (number) the number of spaces inside each bracket.
    • zeroValue: (number) Optional. The number of spaces inside each bracket if the NBT compound is empty ([]). The same number as inside will be used if this is not specified.
    • oneValue: (number) Optional. The number of spaces inside each bracket if the NBT compound has exact one value. The same number as inside will be used if this is not specified.

Examples

Default

{
    "selectorBracketSpacing": { "inside": 0 }
}

👍 Good

kill @e[]
kill @e[type=!minecraft:player]

👎 Bad

kill @e[ ]
kill @e[ type=!minecraft:player ]

Spacious

{
    "selectorBracketSpacing": { "inside": 1, "zeroValue": 0 }
}

👍 Good

kill @e[]
kill @e[ type=!minecraft:player ]

👎 Bad

kill @e[ ]
kill @e[type=!minecraft:player]

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally