Block Temperature

Cold Sweat has two methods for registering block temperatures, depending on how granular the developer's control must be:

Base Configuration

ColdSweatEvents.registries(event =>
{
    // First two parameters are block temperature and units
    event.addBlockTemperature(25.0, "f",
        // Third parameter is a builder-style block temperature definition
        blockTemp =>
        // Registers the block temperature to these blocks
        blockTemp.blocks("minecraft:bee_nest", "minecraft:bee_hive", "#minecraft:logs")
                 // Same as maxEffect from the configs.
                 .maxEffect(50)
                 // Max environment temperature in which the block will be effective
                 .maxTemperature(200)
                 // Range of the block
                 .range(3)
                 // The block must have this state to be valid. Can be a boolean, integer, or string
                 .state("lit", true)
                 // Causes the block temperature to not fade depending on the player's distance
                 .fades(false)
                 // Predicate for the block to match to be considered valid
                 // This "block" is a BlockContainerJS, which also holds world, position, state, and block-entity data
                 .blockPredicate(block => {
                    return block.getLevel().isDay()
                 }))
})

Custom Temperature Definition

If more control is needed over how the block calculates its temperature, a more advanced version of this method can be used:

Last updated