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.world.level.storage.loot.predicates.LootItemCondition> predicate, Optional<net.minecraft.world.entity.EntityType<?>> entityType, net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange, int loadingPriority) Deprecated, for removal: This API element is subject to removal in a future version.This constructor was previously exposed in the API, but should have been kept internal.ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate, net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes, net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange, int loadingPriority) -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(net.minecraft.world.entity.LivingEntity victim) Tests and applies this effect to a living entity, and returns success if it was applied.voidapplyIfPossible(net.minecraft.world.entity.LivingEntity victim) Deprecated.config()Optional<net.minecraft.world.entity.EntityType<?>> Deprecated, for removal: This API element is subject to removal in a future version.UseentityTypes()net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> intOptional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> voidremove(net.minecraft.world.entity.LivingEntity victim) Called the first tick that a configured temperature effect could not be appliednet.minecraft.advancements.critereon.MinMaxBounds.Doublestype()
-
Field Details
-
CODEC
Codec for all configured temperature effects. Dispatches config codec based on type.
-
-
Constructor Details
-
ConfiguredTemperatureEffect
@Internal @Deprecated(since="4.3", forRemoval=true) public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate, Optional<net.minecraft.world.entity.EntityType<?>> entityType, net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange, int loadingPriority) Deprecated, for removal: This API element is subject to removal in a future version.This constructor was previously exposed in the API, but should have been kept internal. Please only construct new instances of this class through a datapack.Constructs a new configured temperature effect. -
ConfiguredTemperatureEffect
@Internal public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate, net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes, net.minecraft.advancements.critereon.MinMaxBounds.Doubles 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.world.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.world.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.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes() -
entityType
@Deprecated(since="4.3", forRemoval=true) public Optional<net.minecraft.world.entity.EntityType<?>> entityType()Deprecated, for removal: This API element is subject to removal in a future version.UseentityTypes()- Returns:
- Returns the first entity type in
entityTypes, if present
-
temperatureScaleRange
public net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange() -
loadingPriority
public int loadingPriority()
-