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

helix / EntityEffect

Variable: EntityEffect โ€‹

EntityEffect: object

Defined in: core/values/enchantment/entity-effect.ts:13

Each of vanilla's entity effects. Pass them to an enchantment's hitBlock, postAttack, tick, projectileSpawned... Every one also works as a LocationEffect.

Type Declaration โ€‹

allOf โ€‹

allOf: (effects) => JsonValue<"entity_effect">

Runs each in order.

Parameters โ€‹

effects โ€‹

readonly EntityEffect[]

Returns โ€‹

JsonValue<"entity_effect">

applyExhaustion โ€‹

applyExhaustion: (amount) => JsonValue<"entity_effect">

Adds hunger exhaustion to a player.

Parameters โ€‹

amount โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

applyImpulse โ€‹

applyImpulse: (f) => JsonValue<"entity_effect">

Pushes it along direction (left, up, forward), scaled per world axis, times magnitude.

Parameters โ€‹

f โ€‹
coordinateScale โ€‹

Xyz

direction โ€‹

Xyz

magnitude โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

applyMobEffect โ€‹

applyMobEffect: (f) => JsonValue<"entity_effect">

One of toApply, picked at random, for a random duration (seconds) and amplifier in range.

Parameters โ€‹

f โ€‹
maxAmplifier โ€‹

LevelBased

maxDuration โ€‹

LevelBased

minAmplifier โ€‹

LevelBased

minDuration โ€‹

LevelBased

toApply โ€‹

MobEffect | readonly MobEffect[]

Returns โ€‹

JsonValue<"entity_effect">

changeItemDamage โ€‹

changeItemDamage: (amount) => JsonValue<"entity_effect">

Damages the enchanted item; negative repairs it. Not in creative.

Parameters โ€‹

amount โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

damageEntity โ€‹

damageEntity: (f) => JsonValue<"entity_effect">

Damage between minDamage and maxDamage.

Parameters โ€‹

f โ€‹
damageType โ€‹

DamageType

maxDamage โ€‹

LevelBased

minDamage โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

damageItem โ€‹

damageItem: (amount) => JsonValue<"entity_effect">

Damages the enchanted item, before 1.21.2 renamed it changeItemDamage.

Parameters โ€‹

amount โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

explode โ€‹

explode: (x) => JsonValue<"entity_effect">

Parameters โ€‹

x โ€‹

Explosion

Returns โ€‹

JsonValue<"entity_effect">

ignite โ€‹

ignite: (duration) => JsonValue<"entity_effect">

Sets it on fire for duration seconds. Flame uses 100.

Parameters โ€‹

duration โ€‹

LevelBased

Returns โ€‹

JsonValue<"entity_effect">

playSound โ€‹

playSound: (f) => JsonValue<"entity_effect">

One sound, or from 1.21.11 one picked at random from a list.

Parameters โ€‹

f โ€‹
pitch โ€‹

FloatProvider

sound โ€‹

SoundRef | readonly SoundRef[]

volume โ€‹

FloatProvider

Returns โ€‹

JsonValue<"entity_effect">

replaceBlock โ€‹

replaceBlock: (f) => JsonValue<"entity_effect">

Parameters โ€‹

f โ€‹

ReplaceBlock

Returns โ€‹

JsonValue<"entity_effect">

replaceDisk โ€‹

replaceDisk: (f) => JsonValue<"entity_effect">

Places blocks in a cylinder radius wide and height tall.

Parameters โ€‹

f โ€‹

ReplaceBlock & object

Returns โ€‹

JsonValue<"entity_effect">

runFunction โ€‹

runFunction: (fn) => JsonValue<"entity_effect">

Runs a function as it, at it. Fine for events; too costly to run every tick.

Parameters โ€‹

fn โ€‹

FunctionRef

Returns โ€‹

JsonValue<"entity_effect">

setBlockProperties โ€‹

setBlockProperties: (f) => JsonValue<"entity_effect">

Sets block-state properties on the block at it, e.g. { lit: "true" }.

Parameters โ€‹

f โ€‹
offset? โ€‹

Xyz

properties โ€‹

Readonly<Record<string, string>>

triggerGameEvent? โ€‹

GameEvent

Returns โ€‹

JsonValue<"entity_effect">

spawnParticles โ€‹

spawnParticles: (f) => JsonValue<"entity_effect">

Parameters โ€‹

f โ€‹
horizontalPosition โ€‹

ParticlePosition

horizontalVelocity โ€‹

ParticleVelocity

particle โ€‹

Particle

speed? โ€‹

number

verticalPosition โ€‹

ParticlePosition

verticalVelocity โ€‹

ParticleVelocity

Returns โ€‹

JsonValue<"entity_effect">

summonEntity โ€‹

summonEntity: (f) => JsonValue<"entity_effect">

Spawns an entity at it: one type, or one picked at random from a list or tag.

Parameters โ€‹

f โ€‹
entity โ€‹

EntityType | readonly EntityType[]

joinTeam? โ€‹

boolean

Returns โ€‹

JsonValue<"entity_effect">

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