Skip to content

Code Actions

SPGoding edited this page Apr 26, 2020 · 8 revisions

Introduction

Code actions is a way to provide quickfixes and refactor operations for your commands.

code-action

Toggle

You can toggle the datapack.features.codeActions setting to enable/disable code actions of DHP.

List of Code Actions

Key Name Ex. Before Ex. After
block-state-sort-keys Sort block state - To the order specified in datapack.lint.blockStateSortKeys
id-attribute-datafix Update this attribute name to 1.16 "generic.maxHealth" "generic.max_health"
id-complete-default-namespace Complete default namespace foo minecraft:foo
id-omit-default-namespace Omit default namespace minecraft:foo foo
nbt-compound-sort-keys Sort NBT compound tag - To the order specified in datapack.lint.nbtCompoundSortKeys
nbt-uuid-datafix Update this UUID to 1.16 {UUIDMost:1L,UUIDLeast:2L} {UUID:[I;0,1,0,2]}
selector-sort-keys Sort selector argument - To the order specified in datapack.lint.selectorSortKeys
string-double-quote Quote this string with double quotation marks 'foo' "foo"
string-single-quote Quote this string with single quotation marks "foo" 'foo'
string-unquote Unquote this string "foo" foo
vector-align-0.0 Align this vector to block origin 1.2 3 4 1.2 3.0 4.0
vector-align-0.5 Align this vector to block center 1.2 3 4 1.2 3.5 4.5

History

Version Description
2.0.0 Added block-state-sort-keys, id-attribute-datafix, id-complete-default-namespace, id-omit-default-namespace, nbt-compound-sort-keys, nbt-uuid-datafix, selector-sort-keys, string-double-quote, string-single-quote, string-unquote, vector-align-0.0, and vector-align-0.5.
Clone this wiki locally