Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

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 โ€‹

protected readonly __kind: K

Defined in: core/values/json-value.ts:19


fields โ€‹

readonly fields: object

Defined in: core/values/json-value.ts:24


gate โ€‹

readonly gate: Gate = {}

Defined in: core/values/json-value.ts:25


options โ€‹

readonly options: object = {}

Defined in: core/values/json-value.ts:26

byVersion? โ€‹

readonly optional byVersion?: (atLeast) => object

Fields for a version, where the format changed between versions.

Parameters โ€‹
atLeast โ€‹

(at) => boolean

Returns โ€‹

object

renamed? โ€‹

readonly optional renamed?: object

Its new type from a version on, where vanilla renamed it.

renamed.since โ€‹

readonly 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 โ€‹

readonly type: string

verbatim? โ€‹

readonly optional verbatim?: boolean

Field names are vanilla's already, not camelCase.


type โ€‹

readonly type: string | undefined

Defined in: core/values/json-value.ts:23

Vanilla's type id without minecraft:, e.g. "summon_entity".

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.