Appearance
helix / JsonValue
Class: JsonValue<K> โ
Defined in: core/values/json-value.ts:17
A piece of data-resource JSON made by a helper such as EntityEffect.ignite(5): vanilla's type (if it has one), its fields in camelCase, and the versions it exists on. The IR writes it as { type: "minecraft:<type>", ...snake_case fields }, so helpers never build JSON.
K is its kind, so an entity effect can't go where a value effect is wanted.
Type Parameters โ
K โ
K extends string
Constructors โ
Constructor โ
new JsonValue<
K>(type,fields,gate?,options?):JsonValue<K>
Defined in: core/values/json-value.ts:21
Parameters โ
type โ
string | undefined
Vanilla's type id without minecraft:, e.g. "summon_entity".
fields โ
object
gate? โ
Gate = {}
options? โ
byVersion? โ
(atLeast) => object
Fields for a version, where the format changed between versions.
renamed? โ
{ since: "1.20.4" | "1.21.4" | "26.2" | "26.3" | "1.16" | "1.16.2" | "1.17" | "1.19" | "1.19.3" | "1.20" | "1.20.2" | "1.20.3" | "1.20.5" | "1.21" | "1.21.11" | "1.21.2" | "1.21.5" | "1.21.6" | "1.21.9" | "26.1" | "26.4"; type: string; }
Its new type from a version on, where vanilla renamed it.
renamed.since โ
"1.20.4" | "1.21.4" | "26.2" | "26.3" | "1.16" | "1.16.2" | "1.17" | "1.19" | "1.19.3" | "1.20" | "1.20.2" | "1.20.3" | "1.20.5" | "1.21" | "1.21.11" | "1.21.2" | "1.21.5" | "1.21.6" | "1.21.9" | "26.1" | "26.4"
renamed.type โ
string
verbatim? โ
boolean
Field names are vanilla's already, not camelCase.
Returns โ
JsonValue<K>
Properties โ
__kind โ
protectedreadonly__kind:K
Defined in: core/values/json-value.ts:19
fields โ
readonlyfields:object
Defined in: core/values/json-value.ts:24
gate โ
readonlygate:Gate={}
Defined in: core/values/json-value.ts:25
options โ
readonlyoptions:object={}
Defined in: core/values/json-value.ts:26
byVersion? โ
readonlyoptionalbyVersion?: (atLeast) =>object
Fields for a version, where the format changed between versions.
Parameters โ
atLeast โ
(at) => boolean
Returns โ
object
renamed? โ
readonlyoptionalrenamed?:object
Its new type from a version on, where vanilla renamed it.
renamed.since โ
readonlysince:"1.20.4"|"1.21.4"|"26.2"|"26.3"|"1.16"|"1.16.2"|"1.17"|"1.19"|"1.19.3"|"1.20"|"1.20.2"|"1.20.3"|"1.20.5"|"1.21"|"1.21.11"|"1.21.2"|"1.21.5"|"1.21.6"|"1.21.9"|"26.1"|"26.4"
renamed.type โ
readonlytype:string
verbatim? โ
readonlyoptionalverbatim?:boolean
Field names are vanilla's already, not camelCase.
type โ
readonlytype:string|undefined
Defined in: core/values/json-value.ts:23
Vanilla's type id without minecraft:, e.g. "summon_entity".