ItemComponent - Swing Animation Component Apply (Section) — SkBee
Addon: SkBee · Category: Section · Since: 3.16.0
Syntax
apply (swing|interact|attack) animation component to %item stacks/item types/slots%Description
Specifies the swing animation to play when attacking or interacting using this item. See [**Attack Animation Component**](https://minecraft.wiki/w/Data_component_format#attack_animation) and [**Interact Animation Component**](https://minecraft.wiki/w/Data_component_format#interact_animation) on McWiki for more details. Requires Minecraft 26.3+
**ENTRIES**: All entries are optional and will use their defaults when omitted. - `type` = String, The type of swinging animation. Can be "none", "whack", "stab". Defaults to "whack". - `duration` = A timespan that determines the animation's duration. Defaults to 6 ticks.
Examples
set {_i} to 1 of diamond sword
apply attack animation component to {_i}:
type: "stab"
duration: 60 ticks
give player 1 of {_i}