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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for the chargeable component. -
Method Summary
Modifier and TypeMethodDescriptionThe identifiers of the Bedrock items that can be used as ammunition by this bow.static GeyserChargeable.Builderbuilder()Creates a builder for the Chargeable component.booleanWhether the item is being charged when being drawn, like a crossbow.@org.checkerframework.checker.index.qual.NonNegative floatThe 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 to0.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 tofalse.- 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 containminecraft:arrowto allow arrows to be shot.Items listed must have a
minecraft:projectilecomponent on bedrock to work. Non-vanilla custom items can mark an item as a projectile and add this component by specifying theGeyserItemDataComponents.PROJECTILEcomponent.- Returns:
- all valid ammunition items
- Since:
- 2.9.3
-
builder
Creates a builder for the Chargeable component.- Returns:
- a new builder
- Since:
- 2.9.3
-