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 Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Builder interface for temperature sources, primarily intended for use with data generation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    builder(net.minecraft.network.chat.Component description)
    net.minecraft.network.chat.Component
    A 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) int
    If this source provides temperature changes on a ticked interval, this controls how often those updates apply.
  • Field Details

    • DIRECT_CODEC

      static final com.mojang.serialization.Codec<TemperatureSource> DIRECT_CODEC
      Direct codec for a temperature source object.
    • CODEC

      static final com.mojang.serialization.Codec<net.minecraft.core.Holder<TemperatureSource>> CODEC
      Codec for temperature source registry objects.
  • Method Details

    • builder

      static TemperatureSource.Builder builder(net.minecraft.network.chat.Component description)
      Parameters:
      description - Text component that describes the source, may not be null.
    • description

      net.minecraft.network.chat.Component description()
      A text component that provides a human-readable name for the source.
    • 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 than 0, a listener must be registered to the event LivingEntityTemperatureTickEvents.getTemperatureChange(ResourceKey) for it to tick.

      Returns:
      Returns an int that is not negative.