Interface EnvironmentTickContext<T extends TemperatureAware & Soakable>
- Type Parameters:
T- The temperature aware type
- All Known Implementing Classes:
EnvironmentTickContextImpl
Context objects for general temperature ticking events on temperature awares and soakables
-
Method Summary
Modifier and TypeMethodDescriptionaffected()The temperature aware/soakable being tickednet.minecraft.component.ComponentMapThe current environment components at the world and position.@NotNull net.minecraft.util.math.BlockPospos()The block position of the affected temperature aware/soakable.@NotNull net.minecraft.server.world.ServerWorldworld()The server world of the affected temperature aware/soakable
-
Method Details
-
affected
The temperature aware/soakable being ticked -
world
@NotNull @NotNull net.minecraft.server.world.ServerWorld world()The server world of the affected temperature aware/soakable -
pos
@NotNull @NotNull net.minecraft.util.math.BlockPos pos()The block position of the affected temperature aware/soakable. This should be preferred over using methods such asEntity.getBlockPos()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.component.ComponentMap 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
ComponentsAccess.getOrDefault(ComponentType, 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
-