Interface EnvironmentTickContext<T extends TemperatureAware & Soakable>

Type Parameters:
T - The temperature aware type
All Known Implementing Classes:
EnvironmentTickContextImpl

@NonExtendable public interface EnvironmentTickContext<T extends TemperatureAware & Soakable>
Context objects for general temperature ticking events on temperature awares and soakables
  • Method Summary

    Modifier and Type
    Method
    Description
    The temperature aware/soakable being ticked
    net.minecraft.core.component.DataComponentMap
    The current environment components at the world and position.
    @NotNull net.minecraft.server.level.ServerLevel
    The server level of the affected temperature aware/soakable
    @NotNull net.minecraft.core.BlockPos
    pos()
    The block position of the affected temperature aware/soakable.
    default @NotNull net.minecraft.server.level.ServerLevel
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method was named based on Yarn Mappings.
  • Method Details

    • affected

      @NotNull T affected()
      The temperature aware/soakable being ticked
    • world

      @NotNull @Deprecated(since="8.1.0", forRemoval=true) default @NotNull net.minecraft.server.level.ServerLevel world()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method was named based on Yarn Mappings. Use level() to better conform to Official Mappings.
    • level

      @NotNull @NotNull net.minecraft.server.level.ServerLevel level()
      The server level of the affected temperature aware/soakable
    • pos

      @NotNull @NotNull net.minecraft.core.BlockPos pos()
      The block position of the affected temperature aware/soakable. This should be preferred over using methods such as Entity.blockPosition() since it can correct for being slightly sunk into blocks like mud or soul sand by taking the block position that is slightly above their actual position.
    • components

      net.minecraft.core.component.DataComponentMap components()
      The current environment components at the world and position.

      No key is guaranteed to be mapped to a value, be sure to always check the result or use DataComponentGetter.getOrDefault(net.minecraft.core.component.DataComponentType, Object).

      Environment components are only looked up for players by default, for all other entity types this map is empty.

      Returns:
      Returns an environment component map