#effects

9 messages · Page 1 of 1 (latest)

ebon stone
#

Can i remove effects from players every tick or something or as soon as the get a spefic effect ? if so how

cunning sphinxBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

tropic shoalBOT
#

[➤](#1212385881281921024 message)

ForgeEvents.onEvent("net.minecraftforge.event.entity.living.MobEffectEvent$Added", event => global.effects(event));
/**
 * 
 * @param {Internal.MobEffectEvent$Added} event 
 */
global.effects = event => {
    const { effectInstance, effectInstance: { descriptionId }, entity } = event
    const night_vision = entity.activeEffects.toString().includes('minecraft.night_vision')
    const leaping = entity.activeEffects.toString().includes('minecraft.jump_boost')
    const pathogen = entity.activeEffects.toString().includes('minecraft.regeneration')
    const effectDuration = effectInstance.duration
    if (pathogen) return
    console.log(descriptionId)
    if ((descriptionId == "effect.minecraft.night_vision" && leaping) ||
        (descriptionId == "effect.minecraft.jump_boost" && night_vision)) {
        entity.server.scheduleInTicks(1, () => {
            entity.removeEffect("minecraft:night_vision")
            entity.removeEffect("minecraft:jump_boost")
        })

        entity.potionEffects.add("minecraft:regeneration", effectDuration)
    }
}```
ebon stone
tropic shoalBOT
#

Paste version of 8XhgYIw.txt from @ebon stone

clever bobcat
#
ForgeEvents.onEvent("net.minecraftforge.event.entity.living.MobEffectEvent$Added", e => {
    const {effectInstance, entity} = e;
    if(effectInstance.descriptionId == 'effectA id') {
        entity.removeEffect('effectB id')
    }
})
#

startup

ebon stone
#

weird