generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
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.
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
LivingEntity entity; // source this from somewhere
entity.thermoo$setWetTicks(10); // works without needing to cast to TemperatureAware
LivingEntity entity; // source this from somewhere
int wet = entity.thermoo$getWetTicks();
LivingEntity entity; // source this from somwhere
float scale = entity.thermoo$getSoakedScale(); // Returns percentage scale from 0-1 and clamped.
➡️ Next: Environment Controller and Events