Skip to content

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.

redscript
fn speed(target: selector, duration: int, level: int)

Parameters

ParameterDescription
targetEntity selector (e.g. @p, @a, @e[...])
durationEffect duration in ticks (20 ticks = 1 second)
levelAmplifier level (0 = Speed I, 1 = Speed II, ...)

Returns: void — applies minecraft:speed effect

Example

redscript
speed(@p, 200, 1)  // Speed II for 10 seconds

jump v1.0.0

Give a jump boost to the target entity.

redscript
fn jump(target: selector, duration: int, level: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks
levelAmplifier level (0 = Jump Boost I, 1 = Jump Boost II, ...)

Returns: void — applies minecraft:jump_boost effect

Example

redscript
jump(@p, 100, 0)  // Jump Boost I for 5 seconds

regen v1.0.0

Give regeneration to the target entity.

redscript
fn regen(target: selector, duration: int, level: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks
levelAmplifier level (0 = Regeneration I, ...)

Returns: void — applies minecraft:regeneration effect

Example

redscript
regen(@p, 60, 0)  // Regeneration I for 3 seconds

resistance v1.0.0

Give damage resistance to the target entity.

redscript
fn resistance(target: selector, duration: int, level: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks
levelAmplifier level (0 = Resistance I, ...)

Returns: void — applies minecraft:resistance effect

Example

redscript
resistance(@p, 400, 0)  // Resistance I for 20 seconds

strength v1.0.0

Give strength to the target entity.

redscript
fn strength(target: selector, duration: int, level: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks
levelAmplifier level (0 = Strength I, 1 = Strength II, ...)

Returns: void — applies minecraft:strength effect

Example

redscript
strength(@p, 200, 1)  // Strength II for 10 seconds

invisible v1.0.0

Make the target entity invisible.

redscript
fn invisible(target: selector, duration: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks

Returns: void — applies minecraft:invisibility at amplifier 0

Example

redscript
invisible(@p, 300)  // invisibility for 15 seconds

night_vision v1.0.0

Give night vision to the target entity.

redscript
fn night_vision(target: selector, duration: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks

Returns: void — applies minecraft:night_vision at amplifier 0

Example

redscript
night_vision(@p, 6000)  // night vision for 5 minutes

slow_fall v1.0.0

Give slow falling to the target entity.

redscript
fn slow_fall(target: selector, duration: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks

Returns: void — applies minecraft:slow_falling at amplifier 0

Example

redscript
slow_fall(@p, 200)  // slow falling for 10 seconds

glow v1.0.0

Give the glowing outline effect to the target entity.

redscript
fn glow(target: selector, duration: int)

Parameters

ParameterDescription
targetEntity selector
durationEffect duration in ticks

Returns: void — applies minecraft:glowing at amplifier 0

Example

redscript
glow(@e[type=zombie], 100)  // make all zombies glow for 5 seconds

clear_effects v1.0.0

Clear all active effects from the target entity.

redscript
fn clear_effects(target: selector)

Parameters

ParameterDescription
targetEntity selector

Returns: void — removes all potion effects via effect_clear

Example

redscript
clear_effects(@p)  // remove all effects from nearest player

clear_effect v1.0.0

Clear a specific effect from the target entity.

redscript
fn clear_effect(target: selector, eff: string)

Parameters

ParameterDescription
targetEntity selector
effEffect resource location string (e.g. "minecraft:speed")

Returns: void — removes the specified potion effect

Example

redscript
clear_effect(@p, "minecraft:poison")  // cure poison

buff_all v1.0.0

Apply a full buff package (Speed I, Strength I, Regeneration I, Resistance I).

redscript
fn buff_all(target: selector, duration: int)

Parameters

ParameterDescription
targetEntity selector
durationDuration in ticks for all four effects

Returns: void — applies speed, strength, regen, and resistance at level 1 (or 0 for resistance)

Example

redscript
buff_all(@p, 600)  // full buff for 30 seconds

Released under the MIT License.