Interface TemperatureSource
- All Known Implementing Classes:
TemperatureSourceImpl
@NonExtendable
public interface TemperatureSource
Describes a source of a temperature change and provides methods for reduction.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classBuilder interface for temperature sources, primarily intended for use with data generation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<TemperatureSource>> Codec for temperature source registry objects.static final com.mojang.serialization.Codec<TemperatureSource> Direct codec for a temperature source object. -
Method Summary
Modifier and TypeMethodDescriptionstatic TemperatureSource.Builderbuilder(net.minecraft.network.chat.Component description) Creates a newTemperatureSource.Builder.net.minecraft.network.chat.ComponentA text component that provides a human-readable name for the source.An optional method of reduction of temperature changes applied from this source.@Range(from=0L,to=2147483647L) intIf this source provides temperature changes on a ticked interval, this controls how often those updates apply.
-
Field Details
-
DIRECT_CODEC
Direct codec for a temperature source object. -
CODEC
Codec for temperature source registry objects.
-
-
Method Details
-
builder
Creates a newTemperatureSource.Builder.- Parameters:
description- Text component that describes the source, may not benull.
-
description
net.minecraft.network.chat.Component description()A text component that provides a human-readable name for the source. -
reduction
Optional<TemperatureReduction> reduction()An optional method of reduction of temperature changes applied from this source. -
tickInterval
@Range(from=0L,to=2147483647L) int tickInterval()If this source provides temperature changes on a ticked interval, this controls how often those updates apply.If the interval is
0, then it will not tick at all. For any value greater than0, a listener must be registered to the eventLivingEntityTemperatureTickEvents.getTemperatureChange(ResourceKey)for it to tick.- Returns:
- Returns an int that is not negative.
-