-
Notifications
You must be signed in to change notification settings - Fork 0
Pausing Status Effects
Notice: This page describes features that can only be used by mod developers using the Java programming language.
Using RealmEngine as your mod's dependency allows you to hook into the IPausableEffect interface to determine conditions for your mob effect's duration to be put on pause.
To change if an effect should be paused or not, simply call realmengine$setDurationPaused after wrapping and casting a mobEffectInstance to IPausableEffect. realmengine$setDurationPaused accepts only a boolean value.
[Example provided from Realmfall]
public void applyEffectTick(LivingEntity entity, int tick) {
((IPausableEffect) entity.getEffect(this))
.realmengine$setDurationPaused(entity.hasEffect(ModEffects.GENE_SHUFFLE_PAUSE.get()));
super.applyEffectTick(entity, tick);
}This pauses the duration countdown of the effect when the entity has the GENE_SHUFFLE_PAUSE effect currently applied to it, and resumes the duration countdown when the entity no longer has that effect.
Modoromu: Programming, documentation, design
Nischi: Programming, documentation
RealmEngine is licensed under the GPL-3.0 license and is free to modify and use.