Class CustomArrowItem<T extends CustomArrowEntity>
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 ClassesModifier and TypeClassDescriptionstatic classstatic final recordNested classes/interfaces inherited from class net.minecraft.world.item.Item
net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.TooltipContextNested classes/interfaces inherited from interface net.minecraft.world.item.ProjectileItem
net.minecraft.world.item.ProjectileItem.DispenseConfig, net.minecraft.world.item.ProjectileItem.PositionFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intfinal doubleFields 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_CODECFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCustomArrowItem(net.minecraft.world.item.Item.Properties properties, double damage, Supplier<net.minecraft.world.entity.EntityType<T>> arrowEntity, int pierceLevel, boolean canBeInfinite, double gravityModifier, CustomArrowItem.InaccuracySettings inaccuracySettings, int knockbackStrength, HitEffectUtils.HitEffect hitEffect, int color) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.entity.projectile.ProjectileasProjectile(net.minecraft.world.level.Level level, net.minecraft.core.Position pos, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction direction) booleannet.minecraft.world.entity.projectile.AbstractArrowcreateArrow(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack ammo, net.minecraft.world.entity.LivingEntity shooter, net.minecraft.world.item.ItemStack weapon) booleanisInfinite(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, computeDefaultResource, 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, useOnReleaseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canEquip, canFitInsideContainerItems, 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, supportsEnchantmentMethods 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, CustomArrowItem.InaccuracySettings inaccuracySettings, 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:
createArrowin classnet.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:
asProjectilein interfacenet.minecraft.world.item.ProjectileItem- Overrides:
asProjectilein classnet.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:
isInfinitein classnet.minecraft.world.item.ArrowItem- Parameters:
arrow- the arrow being checkedbow- the bow firing the arrowshooter- the entity firing the bow- Returns:
- boolean
-