Here you can find information on the exported functions, tags, and more inside of the Data Packs created by the Data Pack Exporter.
Function arguments are handled via fakeplayers stored in the aj.i
scoreboard.
Their names start with #
to distinguish them.
The summon function is used to summon a rig in-game.
/function animated_java:<project_name>/summon
#variant
The ID of the variant to apply to the Rig.#animation
The animation to extract the summon pose from. (Defaults to -1, the model's default pose without animations.)#frame
The frame of the selected animation to apply to the Rig. Only used if #animation
is also specified.The following example will summon a Rig with variant ghost
and the pose of animation test
at frame 20
.
scoreboard players operation #variant aj.i = $aj.<project_name>.variant.ghost aj.id
scoreboard players operation #animation aj.i = $aj.<project_name>.animation.test aj.id
scoreboard players set #frame aj.i 20
function animated_java:<project_name>/summon
The variant summon functions are convenience functions that allow you to summon a rig with a specific variant without needing scoreboard arguments.
Note that these functions can be disabled via the Data Pack Exporter settings.
/execute as @e[type=#animated_java:root,tag=aj.<project_name>.root] run function animated_java:<project_name>/summon/<variant_name>
You can swap Variants on a model via the set_variant functions.
/execute as @e[type=#animated_java:root,tag=aj.<project_name>.root] run function animated_java:<project_name>/set_variant/<variant_name>
You can control the playback of a Rig's animations by executing the animation's control functions as the root entity of the Rig.
/execute as @e[type=#animated_java:root,tag=aj.<project_name>.root] run function animated_java:<project_name>/<animation_name>/play
Note that when you start or resume a new animation, you first need to pause/stop any other playing animations on the Rig that affect the same bones or the animation will break.
You can pause all animations at once using the pause_all_animations
function.
/execute as @e[type=#animated_java:root,tag=aj.<project_name>.root] run function animated_java:<project_name>/animations/pause_all
Plays the animation from the beginning.
Pauses the animation at it's current frame.
Resumes the animation from it's current frame.
Stops the animation and resets it to the first frame.
Tweens the Rigs current animation pose to the first frame of the tweening animation, then plays the tweened animation.
#tween_duration
- The duration of the tween transition in ticks.Tweens the Rigs current animation pose to the frame at in the tweening animation at the current aj.anim_time
, Then resumes the tweened animation.
#tween_duration
- The duration of the tween transition in ticks.