Package net.minecraft.world.item
Class ProjectileWeaponItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ProjectileWeaponItem
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IForgeItem
- Direct Known Subclasses:
BowItem
,CrossbowItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTH, STREAM_CODEC
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Projectile
createProjectile
(Level p_333069_, LivingEntity p_334736_, ItemStack p_333680_, ItemStack p_329118_, boolean p_336242_) customArrow
(AbstractArrow arrow) draw
(ItemStack p_329054_, ItemStack p_328618_, LivingEntity p_335616_) abstract int
protected int
getDurabilityUse
(ItemStack p_330687_) int
static ItemStack
getHeldProjectile
(LivingEntity p_43011_, Predicate<ItemStack> p_43012_) protected void
shoot
(ServerLevel p_344476_, LivingEntity p_332682_, InteractionHand p_333462_, ItemStack p_333670_, List<ItemStack> p_328443_, float p_330956_, float p_333326_, boolean p_332457_, LivingEntity p_328954_) protected abstract void
shootProjectile
(LivingEntity p_330864_, Projectile p_328720_, int p_328740_, float p_335337_, float p_332934_, float p_329948_, LivingEntity p_329516_) protected static ItemStack
useAmmo
(ItemStack p_335938_, ItemStack p_332014_, LivingEntity p_332327_, boolean p_327685_) Methods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isValidRepairItem, mineBlock, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, 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.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDefaultTooltipHideFlags, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getHighlightTip, getSweepHitBox, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
ARROW_ONLY
-
ARROW_OR_FIREWORK
-
-
Constructor Details
-
ProjectileWeaponItem
-
-
Method Details
-
getSupportedHeldProjectiles
-
getAllSupportedProjectiles
-
getHeldProjectile
-
getEnchantmentValue
public int getEnchantmentValue()- Overrides:
getEnchantmentValue
in classItem
-
getDefaultProjectileRange
public abstract int getDefaultProjectileRange() -
shoot
protected void shoot(ServerLevel p_344476_, LivingEntity p_332682_, InteractionHand p_333462_, ItemStack p_333670_, List<ItemStack> p_328443_, float p_330956_, float p_333326_, boolean p_332457_, @Nullable LivingEntity p_328954_) -
getDurabilityUse
-
shootProjectile
protected abstract void shootProjectile(LivingEntity p_330864_, Projectile p_328720_, int p_328740_, float p_335337_, float p_332934_, float p_329948_, @Nullable LivingEntity p_329516_) -
createProjectile
protected Projectile createProjectile(Level p_333069_, LivingEntity p_334736_, ItemStack p_333680_, ItemStack p_329118_, boolean p_336242_) -
draw
protected static List<ItemStack> draw(ItemStack p_329054_, ItemStack p_328618_, LivingEntity p_335616_) -
useAmmo
protected static ItemStack useAmmo(ItemStack p_335938_, ItemStack p_332014_, LivingEntity p_332327_, boolean p_327685_) -
customArrow
-