Class StatusEffectTemperatureEffect
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect<StatusEffectTemperatureEffect.Config>
com.github.thedeathlycow.thermoo.api.temperature.effects.StatusEffectTemperatureEffect
public class StatusEffectTemperatureEffect
extends TemperatureEffect<StatusEffectTemperatureEffect.Config>
Applies
MobEffects to LivingEntitys if their temperature scale is within a given range.
The type, duration, and intensity can all be configured of each status effect can be configured. May specify 1 or more effects to all be applied at once.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<StatusEffectTemperatureEffect.Config> -
Constructor Summary
ConstructorsConstructorDescriptionStatusEffectTemperatureEffect(com.mojang.serialization.Codec<StatusEffectTemperatureEffect.Config> configCodec) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, StatusEffectTemperatureEffect.Config config) Applies the effect to a living entitybooleanshouldApply(net.minecraft.world.entity.LivingEntity victim, StatusEffectTemperatureEffect.Config config) Tests if the effect should be applied to a living entity.Methods inherited from class com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect
getCodec, remove
-
Field Details
-
CODEC
-
-
Constructor Details
-
StatusEffectTemperatureEffect
public StatusEffectTemperatureEffect(com.mojang.serialization.Codec<StatusEffectTemperatureEffect.Config> configCodec)
-
-
Method Details
-
apply
public void apply(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, StatusEffectTemperatureEffect.Config config) Description copied from class:TemperatureEffectApplies the effect to a living entity- Specified by:
applyin classTemperatureEffect<StatusEffectTemperatureEffect.Config>- Parameters:
victim- The living entity to apply the effect toserverWorld- The server world of the victimconfig- The effect config
-
shouldApply
public boolean shouldApply(net.minecraft.world.entity.LivingEntity victim, StatusEffectTemperatureEffect.Config config) Description copied from class:TemperatureEffectTests if the effect should be applied to a living entity. Note that even if this returnstrue, the effect is not guaranteed to be applied. This is because all entity must pass the predicate specified byConfiguredTemperatureEffect.predicate().- Specified by:
shouldApplyin classTemperatureEffect<StatusEffectTemperatureEffect.Config>- Parameters:
victim- The victim to test if the effect should be applied toconfig- The effect config- Returns:
- Returns if the effect should be applied to the victim
-