| title | Controlling a Rig Instance |
|---|---|
| description | Learn how to control a Rig Instance. |
{ $frontmatter.description }
Before we can control a Rig Instance, we need to be able to select it. The following selectors can be used to select Rig Instances:
@e[type=item_display,tag=aj.global.root]@e[type=item_display, tag=aj.<export_namespace>.root]Similar to how we control normal entities in Minecraft, we can move and rotate Rig Instances using the tp or rotate command.
execute as @e[type=item_display,tag=aj.<export_namespace>.root] at @s run \
tp @s ~5 ~ ~execute as @e[type=item_display,tag=aj.<export_namespace>.root] at @s run \
rotate @s ~90 ~execute as @e[type=item_display,tag=aj.<export_namespace>.root] at @s run \
tp @s ~ ~5 ~ ~90 ~Variants can be applied to the Rig Instance using the desired Variant's apply function.
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
function animated_java:<export_namespace>/variants/angry/applyThere is no way to remove a Variant individually once it has been applied. To reset the Variant to it's default state, you can apply the default Variant.
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
function animated_java:<export_namespace>/variants/default/apply:::admonition type=warning Applying the default Variant will not remove any NBT the Variant has modified due to bone configs.
You will have to manually reset the NBT to it's default state, or re-summon the Rig Instance. :::