Interface CrossbowExtensions


@InjectedInterface(net.minecraft.item.CrossbowItem.class) public interface CrossbowExtensions
An interface to implement for all custom crossbows in Quilt.

This is meant to be used on a CrossbowItem class.

In order to modify the projectile shot from your crossbow, implementing and registering CrossbowShotProjectileEvents.ModifyProjectileFromCrossbow is recommended.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default float
    getProjectileSpeed(@NotNull net.minecraft.item.ItemStack stack, @NotNull net.minecraft.component.type.ChargedProjectilesComponent component, @NotNull net.minecraft.entity.LivingEntity entity)
    Allows modifying the speed of the crossbow projectile.
  • Method Details

    • getProjectileSpeed

      default float getProjectileSpeed(@NotNull @NotNull net.minecraft.item.ItemStack stack, @NotNull @NotNull net.minecraft.component.type.ChargedProjectilesComponent component, @NotNull @NotNull net.minecraft.entity.LivingEntity entity)
      Allows modifying the speed of the crossbow projectile.

      The default implementation follows the vanilla values for projectiles

      Parameters:
      stack - the item stack for the crossbow
      component - the projectile component for the crossbow
      entity - the entity shooting the crossbow
      Returns:
      the speed of the projectile