Effects
Auto-generated from
src/stdlib/effects.mcrs— do not edit manually.
API
speed v1.0.0
Give a speed boost to the target entity.
fn speed(target: selector, duration: int, level: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector (e.g. @p, @a, @e[...]) |
duration | Effect duration in ticks (20 ticks = 1 second) |
level | Amplifier level (0 = Speed I, 1 = Speed II, ...) |
Returns: void — applies minecraft:speed effect
Example
speed(@p, 200, 1) // Speed II for 10 secondsjump v1.0.0
Give a jump boost to the target entity.
fn jump(target: selector, duration: int, level: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
level | Amplifier level (0 = Jump Boost I, 1 = Jump Boost II, ...) |
Returns: void — applies minecraft:jump_boost effect
Example
jump(@p, 100, 0) // Jump Boost I for 5 secondsregen v1.0.0
Give regeneration to the target entity.
fn regen(target: selector, duration: int, level: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
level | Amplifier level (0 = Regeneration I, ...) |
Returns: void — applies minecraft:regeneration effect
Example
regen(@p, 60, 0) // Regeneration I for 3 secondsresistance v1.0.0
Give damage resistance to the target entity.
fn resistance(target: selector, duration: int, level: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
level | Amplifier level (0 = Resistance I, ...) |
Returns: void — applies minecraft:resistance effect
Example
resistance(@p, 400, 0) // Resistance I for 20 secondsstrength v1.0.0
Give strength to the target entity.
fn strength(target: selector, duration: int, level: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
level | Amplifier level (0 = Strength I, 1 = Strength II, ...) |
Returns: void — applies minecraft:strength effect
Example
strength(@p, 200, 1) // Strength II for 10 secondsinvisible v1.0.0
Make the target entity invisible.
fn invisible(target: selector, duration: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
Returns: void — applies minecraft:invisibility at amplifier 0
Example
invisible(@p, 300) // invisibility for 15 secondsnight_vision v1.0.0
Give night vision to the target entity.
fn night_vision(target: selector, duration: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
Returns: void — applies minecraft:night_vision at amplifier 0
Example
night_vision(@p, 6000) // night vision for 5 minutesslow_fall v1.0.0
Give slow falling to the target entity.
fn slow_fall(target: selector, duration: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
Returns: void — applies minecraft:slow_falling at amplifier 0
Example
slow_fall(@p, 200) // slow falling for 10 secondsglow v1.0.0
Give the glowing outline effect to the target entity.
fn glow(target: selector, duration: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Effect duration in ticks |
Returns: void — applies minecraft:glowing at amplifier 0
Example
glow(@e[type=zombie], 100) // make all zombies glow for 5 secondsclear_effects v1.0.0
Clear all active effects from the target entity.
fn clear_effects(target: selector)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
Returns: void — removes all potion effects via effect_clear
Example
clear_effects(@p) // remove all effects from nearest playerclear_effect v1.0.0
Clear a specific effect from the target entity.
fn clear_effect(target: selector, eff: string)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
eff | Effect resource location string (e.g. "minecraft:speed") |
Returns: void — removes the specified potion effect
Example
clear_effect(@p, "minecraft:poison") // cure poisonbuff_all v1.0.0
Apply a full buff package (Speed I, Strength I, Regeneration I, Resistance I).
fn buff_all(target: selector, duration: int)Parameters
| Parameter | Description |
|---|---|
target | Entity selector |
duration | Duration in ticks for all four effects |
Returns: void — applies speed, strength, regen, and resistance at level 1 (or 0 for resistance)
Example
buff_all(@p, 600) // full buff for 30 seconds