Download MCAnim — Minecraft Mods — MetaMods
MCAnim

MCAnim

Active

Downloads

0

Last update

1 year ago

Versions

23w06a — 1.21
Server
Libraries
Utils

MCAnim - Minecraft Animation Library by Gears

MCAnim is a datapack library for Minecraft that greatly simplifies the creation and playback of various animations in the game world. Currently, it supports interpolation for display entities, but future versions plan to add functionality for working with particles.

Main Features:

Animation Playback

The system offers four types of animations: generic, scale, translate, and rotate. The universal generic method allows applying multiple animation effects simultaneously, including duration modification. To use it, execute the command data modify storage mcanim:api/display_animation/generic animation set value {}, replacing the curly braces with the desired parameters. Here you can set the duration property, which determines the animation length, while other properties will be processed as animation parameters.

The scale and translate methods work similarly but accept x, y, and z parameters. The rotate function first converts x, y, and z values into quaternions. After configuring the parameters, run the function mcanim:api/display_animation/<function> for the target entity to see the animation in action.

Rotation and Quaternions Handling

The rotation function accepts x, y, and z components in degrees, but since Minecraft uses quaternions to represent rotation, the system automatically converts angles into the appropriate format. This conversion can be performed manually by setting mcanim:api/maths/xyz_to_quaternion target to {x, y, z} or [x, y, z] with the required parameters, then running the function mcanim:api/maths/xyz_to_quaternion. The result will be available in mcanim:api/maths/xyz_to_quaternion output.

The reverse operation is also available - converting a quaternion into x, y, and z components. However, it's important to note that this function currently works incorrectly and produces inaccurate values, so its use is not recommended. To perform the conversion, set mcanim:api/maths/quaternion_to_xyz target to [x, y, z, w] or {x, y, z, w} (the w parameter is ignored and optional), then execute function mcanim:api/maths/quaternion_to_xyz. The resulting array [x, y, z] will be located in mcanim:api/maths/quaternion_to_xyz output.

These are all the functions currently implemented.

Project members
GearsDatapacks

GearsDatapacks

Developer

Created: 11 Feb 2023

ID: 15144