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 p_40513_, ItemStack p_40514_, LivingEntity p_40515_, @Nullable ItemStack p_344832_)
    • asProjectile

      public Projectile asProjectile(Level p_338330_, Position p_338329_, ItemStack p_338197_, Direction p_338469_)
      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