Class DamageTemperatureEffect
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect<DamageTemperatureEffect.Config>
com.github.thedeathlycow.thermoo.api.temperature.effects.DamageTemperatureEffect
public final class DamageTemperatureEffect
extends TemperatureEffect<DamageTemperatureEffect.Config>
Applies damage to
LivingEntitys when their temperature scale is within a given range.
The amount and interval of the damage pulses can be configured, as well as the damage type. However, the DamageSource
applied only stores the type - the direct source entity, attacker, and position are all null.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DamageTemperatureEffect.Config> -
Constructor Summary
ConstructorsConstructorDescriptionDamageTemperatureEffect(com.mojang.serialization.Codec<DamageTemperatureEffect.Config> codec) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(net.minecraft.entity.LivingEntity victim, net.minecraft.server.world.ServerWorld serverWorld, DamageTemperatureEffect.Config config) Applies the effect to a living entitybooleanshouldApply(net.minecraft.entity.LivingEntity victim, DamageTemperatureEffect.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
-
DamageTemperatureEffect
public DamageTemperatureEffect(com.mojang.serialization.Codec<DamageTemperatureEffect.Config> codec)
-
-
Method Details
-
apply
public void apply(net.minecraft.entity.LivingEntity victim, net.minecraft.server.world.ServerWorld serverWorld, DamageTemperatureEffect.Config config) Description copied from class:TemperatureEffectApplies the effect to a living entity- Specified by:
applyin classTemperatureEffect<DamageTemperatureEffect.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.entity.LivingEntity victim, DamageTemperatureEffect.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<DamageTemperatureEffect.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
-