Temperature Basics (Datapacks) - TheDeathlyCow/thermoo GitHub Wiki

[!WARNING] This page has been moved to https://thermoo.thedeathlycow.com/api_overview/

Temperature

Thermoo tracks a piece of data called temperature on all entities that are "alive" (they have health). Temperature is just a number that says how hot or cold an entity is. While this could easily be done with scores, Thermoo is useful when you want to work with other mods or datapacks that may also use temperature as a mechanic, as it provides a single way both types of add-ons can work with this mechanic so that they are compatible with each other.

Bounds

Temperature is also bounded: it has a minimum and maximum amount determined by two custom attributes: thermoo:generic.min_temperature and thermoo:generic.max_temperature. These attributes are just like other attributes that you might add onto items or interact with through the /attribute command. One notable difference is that if clients do not have a mod or resource pack installed that provides translations for the names of the attributes, then they will not show up on the tooltips of items. Instead, you may have to include a server/world resource pack with your server/map, or use the lore to display it instead.

Resistances

A common way that temperature is applied is through a change - the adding or removing of an amount of temperature. The attributes of Frost- and Heat Resistance both control how temperature changes are, as the name implies, resisted. Frost Resistance (thermoo:generic.frost_resistance) deals with negative changes in temperature, while Heat Resistance (thermoo:generic.heat_resistance) deals with positive changes in temperature.

The next section details the different 'modes' of heat change that determine when to apply resistance. However, here it's important to clarify exactly how resistance is applied. Resistance in Thermoo is implemented in a somewhat weird way: resistance is a percentage value between 0 and 10, where a value of 0 corresponds to 0% resistance and a value of 10 corresponds to 100% resistance.

The resistance applied to a temperature change depends on the temperature change itself. If the temperature change is negative (decreasing), the change will be affected by cold resistance; and if the temperature change is positive (increasing), the change will be affected by heat resistance.

How to work with it

As temperature is stored in the NBT data of entities using Cardinal Components. However, this is neither a stable nor efficient way of accessing temperature. Instead, it is preferred to use the command /thermoo temperature, as detailed in the next section.

➡️ Next: Commands