Interface JavaUseEffects


public interface JavaUseEffects
The use effects component is used to specify how the player behaves when using the item.

Currently, the can_sprint property is not supported on Bedrock.

Since:
2.9.3
  • Nested Class Summary

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

    Modifier and Type
    Method
    Description
    static @NonNull JavaUseEffects.Builder
    Creates a builder for the use effects component.
    static @NonNull JavaUseEffects
    of(@org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) float speedMultiplier)
    Creates a use effects component.
    @org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) float
    The speed multiplier to apply to the player while using the item.
  • Method Details

    • speedMultiplier

      @org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) float speedMultiplier()
      The speed multiplier to apply to the player while using the item. Defaults to 0.2.
      Returns:
      the speed multiplier to apply while using the item
      Since:
      2.9.3
    • builder

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

      static @NonNull JavaUseEffects of(@org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) float speedMultiplier)
      Creates a use effects component.
      Parameters:
      speedMultiplier - the speed multiplier to apply while using the item
      Returns:
      the new use effects component
      Since:
      2.9.3