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, Optional<net.minecraft.entity.EntityType<?>> entityType, net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange, int loadingPriority) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyIfPossible(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity if possibleconfig()Optional<net.minecraft.entity.EntityType<?>> intOptional<net.minecraft.loot.condition.LootCondition> net.minecraft.predicate.NumberRange.DoubleRangetype()
-
Field Details
-
CODEC
Codec for all configured temperature effects. Dispatches config codec based on type.
-
-
Constructor Details
-
ConfiguredTemperatureEffect
public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.loot.condition.LootCondition> predicate, Optional<net.minecraft.entity.EntityType<?>> entityType, net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange, int loadingPriority)
-
-
Method Details
-
applyIfPossible
public void applyIfPossible(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity if possible- Parameters:
victim- The living entity to possibly apply the effect to
-
type
-
config
-
predicate
-
entityType
-
temperatureScaleRange
public net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange() -
loadingPriority
public int loadingPriority()
-