Skip to content

Soaking (Mods)

TheDeathlyCow edited this page Mar 25, 2024 · 4 revisions

Similar to temperature, wetness is also a tracked attribute in Thermoo. Soakble entities are defined through the Soakable interface, which is interface injected into LivingEntity so that you may use its methods without needing to cast instances of LivingEntity. Wetness is also a synced data attribute of all living entities.

Usage

Wetness is most commonly used in conjunction with passive temperature changes. When dealing with wetness, it is advised to use the method Soakable#thermoo$getSoakedScale over Soakable#thermoo$getWetTicks as it is scaled to the max wetness, and the individual units of wetness are an arbitrary unit without much meaning. An example of how wetness is used can be found in Scorchful

Examples

Example: Setting wetness of an entity

LivingEntity entity; // source this from somewhere

entity.thermoo$setWetTicks(10); // works without needing to cast to TemperatureAware

Example: Getting wetness of an entity

LivingEntity entity; // source this from somewhere

int wet = entity.thermoo$getWetTicks();

Example: Get the percentage wetness scale of an entity

LivingEntity entity; // source this from somwhere

float scale = entity.thermoo$getSoakedScale(); // Returns percentage scale from 0-1 and clamped.

➡️ Next: Environment Controller and Events