Interface JavaAttackRange
public interface JavaAttackRange
The attack range component is used to specify the
attack ranges of an item. Because of limitations on Bedrock, these only apply to items that also have
a
JavaItemDataComponents.KINETIC_WEAPON or a JavaItemDataComponents.PIERCING_WEAPON component.- Since:
- 2.9.3
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for the attack range component. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull JavaAttackRange.Builderbuilder()Creates a builder for the attack range component.@org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) floatThe margin applied to the target hitbox when attacking.@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) floatThe maximum distance in blocks from the user to the target for the user to be able to attack that target, if the user is in creative mode.@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) floatmaxReach()The maximum distance in blocks from the user to the target for the user to be able to attack that target.@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) floatThe minimum distance in blocks from the user to the target for the user to be able to attack that target, if the user is in creative mode.@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) floatminReach()The minimum distance in blocks from the user to the target for the user to be able to attack that target.
-
Method Details
-
minReach
@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) float minReach()The minimum distance in blocks from the user to the target for the user to be able to attack that target. Defaults to 0.- Returns:
- the minimum distance for attacks, in blocks
- Since:
- 2.9.3
-
maxReach
@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) float maxReach()The maximum distance in blocks from the user to the target for the user to be able to attack that target. Defaults to 3.- Returns:
- the maximum distance for attacks, in blocks
- Since:
- 2.9.3
-
minCreativeReach
@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) float minCreativeReach()The minimum distance in blocks from the user to the target for the user to be able to attack that target, if the user is in creative mode. Defaults to 0.- Returns:
- the minimum distance for attacks made in creative mode, in blocks
- Since:
- 2.9.3
-
maxCreativeReach
@org.checkerframework.common.value.qual.IntRange(from=0L, to=64L) float maxCreativeReach()The maximum distance in blocks from the user to the target for the user to be able to attack that target, if the user is in creative mode. Defaults to 5.- Returns:
- the maximum distance for attacks made in creative mode, in blocks
- Since:
- 2.9.3
-
hitboxMargin
@org.checkerframework.common.value.qual.IntRange(from=0L, to=1L) float hitboxMargin()The margin applied to the target hitbox when attacking. Defaults to 0.3.- Returns:
- the margin applied to the target hitbox when attacking
- Since:
- 2.9.3
-
builder
Creates a builder for the attack range component.- Returns:
- a new builder
- Since:
- 2.9.3
-