Skip to content

Pausing Status Effects

Modrome edited this page Aug 21, 2026 · 2 revisions

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.

Usage

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.

Usage Example

[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.

Clone this wiki locally