Class ConfiguredTemperatureEffect<C>

java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.ConfiguredTemperatureEffect<C>
Type Parameters:
C - The config type

public final class ConfiguredTemperatureEffect<C> extends Object
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 Details

    • CODEC

      public static final com.mojang.serialization.Codec<ConfiguredTemperatureEffect<?>> 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

      public TemperatureEffect<C> type()
    • config

      public C config()
    • predicate

      public Optional<net.minecraft.loot.condition.LootCondition> predicate()
    • entityType

      public Optional<net.minecraft.entity.EntityType<?>> entityType()
    • temperatureScaleRange

      public net.minecraft.predicate.NumberRange.DoubleRange temperatureScaleRange()
    • loadingPriority

      public int loadingPriority()