Round
Provides a rounded off float value.
Type ID: kaya:round
Format
| Field | Type | Default | Description |
|---|---|---|---|
value |
Float Provider | The float to round off. | |
places |
Int Provider | Determines the decimal places to round off the float. | |
rounding_mode |
Rounding Mode | "half_up" |
Determines how the float is rounded off. |
Example
{
"type": "kaya:round",
"value": {
"type": "kaya:entity/attribute",
"attribute": "minecraft:step_height",
"entity": "this"
},
"places": 0
}
This example will provide the value of the minecraft:step_height attribute from the entity provided by the kaya:this_entity context parameter rounded off to 1 digit.
For example, let's say the attribute has a value of $0.6$. The value will be rounded off to $1$.
History
| Minecraft | Mod | Changelog |
| 1.21.5 | 0.1.0 | Added the type. |