From Float
Provides a float converted as an integer.
Type ID: kaya:from_Float
Format
| Field | Type | Default | Description |
|---|---|---|---|
value |
Float Provider | The float value to convert as an integer. |
Example
{
"type": "kaya:from_float",
"value": {
"type": "kaya:round",
"value": {
"type": "kaya:vector/length",
"vector": {
"type": "kaya:entity/velocity",
"entity": "this"
}
},
"places": 0
}
}
This example will round off the length of the velocity of the entity provided by the kaya:this_entity context parameter and convert it into an integer.
For example, let's say the entity's velocity vector is X: $0.0$, Y: $1.0$, Z: $0.3$. The length of the velocity vector will be $1.044030650891055$, which will then be truncated to $1$.
History
| Minecraft | Mod | Changelog |
| 1.21.5 | 0.1.0 | Added the type. |