Class AttributeModifierTemperatureEffect
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect<AttributeModifierTemperatureEffect.Config>
com.github.thedeathlycow.thermoo.api.temperature.effects.AttributeModifierTemperatureEffect
public final class AttributeModifierTemperatureEffect
extends TemperatureEffect<AttributeModifierTemperatureEffect.Config>
A temperature effect that applies an attribute modifier to a victim.
Includes options to increase the modifier in strength with respect to the target's current temperature scale.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AttributeModifierTemperatureEffect.Config> -
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifierTemperatureEffect(com.mojang.serialization.Codec<AttributeModifierTemperatureEffect.Config> configCodec) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, AttributeModifierTemperatureEffect.Config config) Applies the effect to a living entityvoidremove(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, AttributeModifierTemperatureEffect.Config config) Called the first tick that a temperature effect could not be appliedbooleanshouldApply(net.minecraft.world.entity.LivingEntity victim, AttributeModifierTemperatureEffect.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
-
Field Details
-
CODEC
-
-
Constructor Details
-
AttributeModifierTemperatureEffect
public AttributeModifierTemperatureEffect(com.mojang.serialization.Codec<AttributeModifierTemperatureEffect.Config> configCodec)
-
-
Method Details
-
apply
public void apply(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, AttributeModifierTemperatureEffect.Config config) Description copied from class:TemperatureEffectApplies the effect to a living entity- Specified by:
applyin classTemperatureEffect<AttributeModifierTemperatureEffect.Config>- Parameters:
victim- The living entity to apply the effect toserverWorld- The server level of the victimconfig- The effect config
-
shouldApply
public boolean shouldApply(net.minecraft.world.entity.LivingEntity victim, AttributeModifierTemperatureEffect.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<AttributeModifierTemperatureEffect.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
-
remove
public void remove(net.minecraft.world.entity.LivingEntity victim, net.minecraft.server.level.ServerLevel serverWorld, AttributeModifierTemperatureEffect.Config config) Description copied from class:TemperatureEffectCalled the first tick that a temperature effect could not be applied- Overrides:
removein classTemperatureEffect<AttributeModifierTemperatureEffect.Config>- Parameters:
victim- The entity the effect was applied toserverWorld- The server level of the entityconfig- The effect config
-