Appearance
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 โ
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 โ
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 โ
maxDuration โ
minAmplifier โ
minDuration โ
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 โ
Returns โ
JsonValue<"entity_effect">
damageEntity โ
damageEntity: (
f) =>JsonValue<"entity_effect">
Damage between minDamage and maxDamage.
Parameters โ
f โ
damageType โ
maxDamage โ
minDamage โ
Returns โ
JsonValue<"entity_effect">
damageItem โ
damageItem: (
amount) =>JsonValue<"entity_effect">
Damages the enchanted item, before 1.21.2 renamed it changeItemDamage.
Parameters โ
amount โ
Returns โ
JsonValue<"entity_effect">
explode โ
explode: (
x) =>JsonValue<"entity_effect">
Parameters โ
x โ
Returns โ
JsonValue<"entity_effect">
ignite โ
ignite: (
duration) =>JsonValue<"entity_effect">
Sets it on fire for duration seconds. Flame uses 100.
Parameters โ
duration โ
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 โ
sound โ
SoundRef | readonly SoundRef[]
volume โ
Returns โ
JsonValue<"entity_effect">
replaceBlock โ
replaceBlock: (
f) =>JsonValue<"entity_effect">
Parameters โ
f โ
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 โ
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? โ
Returns โ
JsonValue<"entity_effect">
spawnParticles โ
spawnParticles: (
f) =>JsonValue<"entity_effect">
Parameters โ
f โ
horizontalPosition โ
horizontalVelocity โ
particle โ
speed? โ
number
verticalPosition โ
verticalVelocity โ
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">