Skip to content

nbtBoolean

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 use boolean literals to represent boolean-like NBT bytes or not.

  • (false): always use numbers to represent byte values.
  • (true): use true and false to represent 1b and 0b in boolean-like byte values, respectively.

Examples

Default

{
    "nbtBoolean": ["warning", false]
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Invisible: 1b}
summon minecraft:cat ~ ~ ~ {CollarColor: 1b}

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {Invisible: true}
summon minecraft:cat ~ ~ ~ {CollarColor: true}

True

{
    "nbtBoolean": ["warning", true]
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Invisible: true}
summon minecraft:cat ~ ~ ~ {CollarColor: 1b}

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {Invisible: 1b}
summon minecraft:cat ~ ~ ~ {CollarColor: true}

Disabled

{
    "nbtBoolean": null
}

👍 Good

summon minecraft:armor_stand ~ ~ ~ {Invisible: 1b}
summon minecraft:armor_stand ~ ~ ~ {Invisible: true}
summon minecraft:cat ~ ~ ~ {CollarColor: 1b}
summon minecraft:cat ~ ~ ~ {CollarColor: true}

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally