Class ConfiguredTemperatureEffect<C>
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.ConfiguredTemperatureEffect<C>
- Type Parameters:
C- The config type
Represents a configured instance of a
TemperatureEffect type.
See the wiki page for details on
how to implement this in a datapack.
A configured temperature effect is more like an instance of a temperature effect, and this is the class that is directly instantiated from a temperature effect JSON file in a datapack.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ConfiguredTemperatureEffect<?>> Codec for all configured temperature effects. -
Constructor Summary
ConstructorsConstructorDescriptionConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.loot.condition.LootCondition> predicate, net.minecraft.registry.entry.RegistryEntryList<net.minecraft.entity.EntityType<?>> entityTypes, net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange, int loadingPriority) -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity, and returns success if it was applied.voidapplyIfPossible(net.minecraft.entity.LivingEntity victim) Deprecated.config()net.minecraft.registry.entry.RegistryEntryList<net.minecraft.entity.EntityType<?>> intOptional<net.minecraft.loot.condition.LootCondition> voidremove(net.minecraft.entity.LivingEntity victim) Called the first tick that a configured temperature effect could not be appliednet.minecraft.predicate.NumberRange.DoubleRangetype()
-
Field Details
-
CODEC
Codec for all configured temperature effects. Dispatches config codec based on type.
-
-
Constructor Details
-
ConfiguredTemperatureEffect
@Internal public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.loot.condition.LootCondition> predicate, net.minecraft.registry.entry.RegistryEntryList<net.minecraft.entity.EntityType<?>> entityTypes, net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange, int loadingPriority)
-
-
Method Details
-
applyIfPossible
Deprecated.Tests and applies this effect to a living entity if possible- Parameters:
victim- The living entity to possibly apply the effect to
-
apply
public boolean apply(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity, and returns success if it was applied.Returns false on client.
- Parameters:
victim- The living entity to possibly apply the effect to- Returns:
- Returns
trueif the effect was applied.
-
remove
public void remove(net.minecraft.entity.LivingEntity victim) Called the first tick that a configured temperature effect could not be applied- Parameters:
victim- The entity the effect was applied to
-
type
-
config
-
predicate
-
entityTypes
public net.minecraft.registry.entry.RegistryEntryList<net.minecraft.entity.EntityType<?>> entityTypes() -
temperatureScaleRange
public net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange() -
loadingPriority
public int loadingPriority()
-
apply(LivingEntity)