Interface JavaSwingAnimation


public interface JavaSwingAnimation
The swing animation component is used to specify the swing animation to play when attacking or interacting using the item.

Currently, only the duration property is supported on Bedrock.

Since:
2.9.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for the swing animation component.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a builder for the swing animation component.
    @org.checkerframework.checker.index.qual.Positive int
    The duration of the swing animation, in ticks.
    of(@org.checkerframework.checker.index.qual.Positive int duration)
    Creates a swing animation component.
  • Method Details

    • duration

      @org.checkerframework.checker.index.qual.Positive int duration()
      The duration of the swing animation, in ticks. Defaults to 6.
      Returns:
      the duration of the swing animation, in ticks
      Since:
      2.9.3
    • builder

      static JavaSwingAnimation.Builder builder()
      Creates a builder for the swing animation component.
      Returns:
      a new builder
      Since:
      2.9.3
    • of

      static JavaSwingAnimation of(@org.checkerframework.checker.index.qual.Positive int duration)
      Creates a swing animation component.
      Parameters:
      duration - the duration of the swing animation, in ticks
      Returns:
      the new swing animation component
      Since:
      2.9.3