Interface GeyserChargeable


public interface GeyserChargeable
The chargeable component allows creating crossbows or bows. This includes the draw duration, whether the item charges on being drawn, and the ammunition that can be used by the item.
Since:
2.9.3
  • Nested Class Summary

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

    Modifier and Type
    Method
    Description
    The identifiers of the Bedrock items that can be used as ammunition by this bow.
    Creates a builder for the Chargeable component.
    boolean
    Whether the item is being charged when being drawn, like a crossbow.
    @org.checkerframework.checker.index.qual.NonNegative float
    The maximum draw duration determines how long the weapon can be drawn before releasing automatically.
  • Method Details

    • maxDrawDuration

      @org.checkerframework.checker.index.qual.NonNegative float maxDrawDuration()
      The maximum draw duration determines how long the weapon can be drawn before releasing automatically. Defaults to 0.0.
      Returns:
      the maximum draw duration
      Since:
      2.9.3
    • chargeOnDraw

      boolean chargeOnDraw()
      Whether the item is being charged when being drawn, like a crossbow. Defaults to false.
      Returns:
      whether drawing the item charges it
      Since:
      2.9.3
    • ammunition

      List<Identifier> ammunition()
      The identifiers of the Bedrock items that can be used as ammunition by this bow. For example, this can contain minecraft:arrow to allow arrows to be shot.

      Items listed must have a minecraft:projectile component on bedrock to work. Non-vanilla custom items can mark an item as a projectile and add this component by specifying the GeyserItemDataComponents.PROJECTILE component.

      Returns:
      all valid ammunition items
      Since:
      2.9.3
    • builder

      static GeyserChargeable.Builder builder()
      Creates a builder for the Chargeable component.
      Returns:
      a new builder
      Since:
      2.9.3