ItemComponent - Swing Animation Component Apply (Section) — SkBee
Addon: SkBee · Category: Section · Since: 3.16.0
Syntax
apply swing animation component to %itemstacks/itemtypes/slots%Description
Specifies the swing animation to play when attacking or interacting using this item. See [**Swing Animation Component**](https://minecraft.wiki/w/Data_component_format#swing_animation) on McWiki for more details. Requires Minecraft 1.21.11+
**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 swing animation component to {_i}:
type: "stab"
duration: 60 ticks
give player 1 of {_i}