Class ConfiguredTemperatureEffect<C>

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

public 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.
See Also:
  • Constructor Details

    • ConfiguredTemperatureEffect

      public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, @Nullable @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange)
  • Method Details

    • fromJson

      public static <C> ConfiguredTemperatureEffect<C> fromJson(TemperatureEffect<C> type, com.google.gson.JsonElement configJson, com.google.gson.JsonDeserializationContext context, @Nullable @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange) throws com.google.gson.JsonSyntaxException
      Constructs a new ConfiguredTemperatureEffect of a specified type and config JSON object
      Type Parameters:
      C - The type of the effect type config
      Parameters:
      type - The type of the effect to create
      configJson - The config of the type
      context - The JSON deserialization context
      predicate - The entity predicate of the effect
      temperatureScaleRange - Temperature scale range predicate
      Returns:
      Returns a new ConfiguredTemperatureEffect based on the JSON representation given by configJson
      Throws:
      com.google.gson.JsonParseException - Thrown if configJson is not a valid representation of the config type C
      com.google.gson.JsonSyntaxException
    • 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