java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ArrowItem
tech.anonymoushacker1279.immersiveweapons.item.projectile.CustomArrowItem<T>
All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement, net.minecraft.world.item.ProjectileItem, net.minecraft.world.level.ItemLike, net.neoforged.neoforge.common.extensions.IItemExtension

public class CustomArrowItem<T extends CustomArrowEntity> extends net.minecraft.world.item.ArrowItem
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.item.Item

    net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.TooltipContext

    Nested classes/interfaces inherited from interface net.minecraft.world.item.ProjectileItem

    net.minecraft.world.item.ProjectileItem.DispenseConfig, net.minecraft.world.item.ProjectileItem.PositionFunction
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     
    final double
     
    final Supplier<net.minecraft.world.entity.EntityType<T>>
     

    Fields inherited from class net.minecraft.world.item.Item

    ABSOLUTE_MAX_STACK_SIZE, APPROXIMATELY_INFINITE_USE_DURATION, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canCombineRepair, CODEC, DEFAULT_MAX_STACK_SIZE, descriptionId, MAX_BAR_WIDTH, STREAM_CODEC

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CustomArrowItem(net.minecraft.world.item.Item.Properties properties, double damage, Supplier<net.minecraft.world.entity.EntityType<T>> arrowEntity, int pierceLevel, boolean canBeInfinite, double gravityModifier, List<Double> shootingVectorInputs, int knockbackStrength, HitEffectUtils.HitEffect hitEffect, int color)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.entity.projectile.Projectile
    asProjectile(net.minecraft.world.level.Level level, net.minecraft.core.Position pos, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction direction)
     
    boolean
     
    net.minecraft.world.entity.projectile.AbstractArrow
    createArrow(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack ammo, net.minecraft.world.entity.LivingEntity shooter, net.minecraft.world.item.ItemStack weapon)
     
    boolean
    isInfinite(net.minecraft.world.item.ItemStack arrow, net.minecraft.world.item.ItemStack bow, net.minecraft.world.entity.LivingEntity shooter)
    Check if the arrow is infinite.

    Methods inherited from class net.minecraft.world.item.Item

    appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getCraftingRemainder, getDamageSource, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getName, getName, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hurtEnemy, interactLivingEntity, inventoryTick, isBarVisible, isCombineRepairable, isCorrectToolForDrops, isFoil, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, shouldPrintOpWarning, toString, use, useOn, useOnRelease, verifyComponentsAfterLoad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension

    applyEnchantments, canBeHurtBy, canContinueUsing, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, getAllEnchantments, getBurnTime, getCraftingRemainder, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEntityLifespan, getEquipmentSlot, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCustomEntity, isDamageable, isDamaged, isGazeDisguise, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment

    Methods inherited from interface net.minecraft.world.item.ProjectileItem

    createDispenseConfig, shoot
  • Field Details

    • entitySupplier

      public final Supplier<net.minecraft.world.entity.EntityType<T extends CustomArrowEntity>> entitySupplier
    • damage

      public final double damage
    • color

      public final int color
  • Constructor Details

    • CustomArrowItem

      protected CustomArrowItem(net.minecraft.world.item.Item.Properties properties, double damage, Supplier<net.minecraft.world.entity.EntityType<T>> arrowEntity, int pierceLevel, boolean canBeInfinite, double gravityModifier, List<Double> shootingVectorInputs, int knockbackStrength, HitEffectUtils.HitEffect hitEffect, int color)
  • Method Details

    • canBeInfinite

      public boolean canBeInfinite()
    • createArrow

      public net.minecraft.world.entity.projectile.AbstractArrow createArrow(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack ammo, net.minecraft.world.entity.LivingEntity shooter, @Nullable net.minecraft.world.item.ItemStack weapon)
      Overrides:
      createArrow in class net.minecraft.world.item.ArrowItem
    • asProjectile

      public net.minecraft.world.entity.projectile.Projectile asProjectile(net.minecraft.world.level.Level level, net.minecraft.core.Position pos, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction direction)
      Specified by:
      asProjectile in interface net.minecraft.world.item.ProjectileItem
      Overrides:
      asProjectile in class net.minecraft.world.item.ArrowItem
    • isInfinite

      public boolean isInfinite(net.minecraft.world.item.ItemStack arrow, net.minecraft.world.item.ItemStack bow, net.minecraft.world.entity.LivingEntity shooter)
      Check if the arrow is infinite. A more flexible check than Vanilla provides. Restricts the ability to lower level arrows for balance.
      Overrides:
      isInfinite in class net.minecraft.world.item.ArrowItem
      Parameters:
      arrow - the arrow being checked
      bow - the bow firing the arrow
      shooter - the entity firing the bow
      Returns:
      boolean