Feature Request: MoLang fixed values in animation keyframes
It would be useful to have support for generating and storing a random MoLang value when an animation starts, so the value remains fixed for the entire animation.
For example:
variable.muzzle_rotation = math.random(0, 360)
The resulting value could then be used by other keyframes:
This would be useful for effects such as muzzle flashes, particles, recoil, or other animations where each animation play should have a different random value, while keeping that value consistent throughout the animation.
Ideally, the variable assignment would be executed once when the animation starts rather than being re-evaluated on every frame.
Disclaimer
The following environments are not supported, and feature requests relying on these conditions will not be considered:
- Informal / modified launchers (e.g., Feather Client)
- Closed-source mods/plugins (Optifine, ItemsAdder, Nexo, etc.)
- Hybrid server platforms (e.g., Arclight)
- Legacy server versions (1.21.1 or lower)
- Bedrock Edition
- Extremely outdated CPU / hardware
- Features fundamentally **impossible on server-side** due to engine or protocol limitations
Feature Request: MoLang fixed values in animation keyframes
It would be useful to have support for generating and storing a random MoLang value when an animation starts, so the value remains fixed for the entire animation.
For example:
The resulting value could then be used by other keyframes:
This would be useful for effects such as muzzle flashes, particles, recoil, or other animations where each animation play should have a different random value, while keeping that value consistent throughout the animation.
Ideally, the variable assignment would be executed once when the animation starts rather than being re-evaluated on every frame.