Skip to content

idOmitDefaultNamespace

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 or not the default namespaces in namespaced IDs should be omitted. No matter what the setting is, namespaces in predicates (e.g. nbt selector argument, execute if data) should always be kept.

  • (boolean)

Examples

Default

{
    "idOmitDefaultNamespace": null
}

👍 Good

summon armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "stone"}, {}]}
summon minecraft:armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}
kill @e[type=armor_stand,nbt={ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}]
kill @e[type=minecraft:armor_stand,nbt={ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}]

👎 Bad

kill @e[nbt={ArmorItems: [{Count: 1b, id: "stone"}, {}]}]

True

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

👍 Good

summon armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "stone"}, {}]}
kill @e[type=armor_stand,nbt={ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}]

👎 Bad

summon minecraft:armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}
kill @e[type=minecraft:armor_stand,nbt={ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}]
kill @e[type=armor_stand,nbt={ArmorItems: [{Count: 1b, id: "stone"}, {}]}]

False

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

👍 Good

summon minecraft:armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}
kill @e[type=minecraft:armor_stand,nbt={ArmorItems: [{Count: 1b, id: "minecraft:stone"}, {}]}]

👎 Bad

summon armor_stand ~ ~ ~ {ArmorItems: [{Count: 1b, id: "stone"}, {}]}
kill @e[type=armor_stand,nbt={ArmorItems: [{Count: 1b, id: "stone"}, {}]}]

History

This rule was introduced in DHP 2.0.0.

Clone this wiki locally