Class ArrowItem

java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ArrowItem
All Implemented Interfaces:
FeatureElement, ProjectileItem, ItemLike, IItemExtension
Direct Known Subclasses:
SpectralArrowItem, TippedArrowItem

public class ArrowItem extends Item implements ProjectileItem
  • Constructor Details

  • Method Details

    • createArrow

      public AbstractArrow createArrow(Level pLevel, ItemStack pAmmo, LivingEntity pShooter, @Nullable ItemStack pWeapon)
    • asProjectile

      public Projectile asProjectile(Level pLevel, Position pPos, ItemStack pStack, Direction pDirection)
      Specified by:
      asProjectile in interface ProjectileItem
    • isInfinite

      public boolean isInfinite(ItemStack ammo, ItemStack bow, LivingEntity livingEntity)
      Called to determine if this arrow will be infinite when fired. If an arrow is infinite, then the arrow will never be consumed (regardless of enchantments).

      Only called on the logical server.

      Parameters:
      ammo - The ammo stack (containing this item)
      bow - The bow stack
      livingEntity - The entity who is firing the bow
      Returns:
      True if the arrow is infinite