KubeJS Basics
A short overview of Cold Sweat's KubeJS integration
Bindings
Cold Sweat has a custom binding that has some utility functions to make manipulating and accessing temperature easier in JavaScript.
coldsweat
coldsweat
Contains miscellaneous utility methods for Cold Sweat.
getConfigSetting()
getConfigSetting()
Returns a DynamicHolder
containing the value of the specified config setting. The resulting holder has no explicit type, meaning it must be cast.
getRegistryAccess()
getRegistryAccess()
Returns an instance of RegistryAccess, or null if it is not available. See here for important information regarding this method.
getTemperature()
getTemperature()
Returns the value of the specified temperature trait for the given entity. trait
is the trait's snake-cased ID.
setTemperature()
setTemperature()
Sets the value of the specified trait for the given entity. It will likely be replaced next tick for any trait other than core
.
createModifier()
createModifier()
Creates a new temperature modifier instance from the supplier registered to the given ID.
addModifier()
addModifier()
Adds the given modifier to the given entity's specified trait. This method provides a basic way of doing this through JavaScript. For more advanced versions, use the Java-based methods instead.
getTrait()
getTrait()
Returns the Trait
enum constant associated with the given ID. This might be necessary when using Java methods in Cold Sweat.
getColdInsulation()
getColdInsulation()
Returns the sum of all cold insulation from the given entity's armor, curios, etc.
getHeatInsulation()
getHeatInsulation()
Returns the sum of all heat insulation from the given entity's armor, curios, etc.
getBlockTemperature()
getBlockTemperature()
Returns the raw temperature of the given BlockContainer
object (which is what KubeJS refers to as a "block")
getBiomeTemperature()
getBiomeTemperature()
Returns the biome temperature at the given location, taking into account time of day.
getBiomeTemperatureAt()
getBiomeTemperatureAt()
Similar to getBiomeTemperature()
, but also takes altitude into account.
getTemperatureAt()
getTemperatureAt()
Returns the overall ambient temperature at the given position, including nearby blocks, biomes, time of day, depth underground, etc.
Last updated