Interface JavaConsumable


public interface JavaConsumable
The consumable component is used to mark an item as consumable. Further, it allows specifying the consume duration and animation to play when consuming.
Since:
2.9.3
  • Method Details

    • consumeSeconds

      @org.checkerframework.checker.index.qual.Positive float consumeSeconds()
      The seconds it takes to consume the item. This it the amount of time the animation will play for. Defaults to 1.6.
      Returns:
      the consume duration, in seconds
      Since:
      2.9.3
    • animation

      @NonNull JavaConsumable.Animation animation()
      The animation that should play when consuming the item. Defaults to JavaConsumable.Animation.EAT.
      Returns:
      the animation to play
      Since:
      2.9.3
    • builder

      static @NonNull JavaConsumable.Builder builder()
      Creates a builder for the consumable component.
      Returns:
      a new builder
      Since:
      2.9.3
    • of

      static @NonNull JavaConsumable of(float consumeSeconds, JavaConsumable.Animation animation)
      Creates a consumable component.
      Parameters:
      consumeSeconds - the consume duration, in seconds
      animation - the animation to play when consuming
      Returns:
      the consumable component
      Since:
      2.9.3