#Double Effect Duration
3 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
solved with this code:
/**@param {Internal.MobEffectEvent$Applicable} event*/
global.miningDoubled = event => {
const $MobEffects = Java.loadClass("net.minecraft.world.effect.MobEffects")
const $EffectInstance = Java.loadClass("net.minecraft.world.effect.MobEffectInstance")
const {entity, effectInstance:{effect, amplifier, duration, ambient, visible}} = event
if(effect.equals($MobEffects.DIG_SLOWDOWN) && !entity.persistentData.isDoubled) {
event.setResult("deny")
entity.persistentData.putBoolean('isDoubled', true)
Utils.server.scheduleInTicks(20, () => {
entity.persistentData.remove('isDoubled')
})
entity.addEffect(new $EffectInstance(effect, duration * 2, amplifier, ambient, visible))
}
}```