Package net.minecraft.world.item
Class BowItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ProjectileWeaponItem
net.minecraft.world.item.BowItem
- All Implemented Interfaces:
FeatureElement,ItemLike,IItemExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class net.minecraft.world.item.ProjectileWeaponItem
ARROW_ONLY, ARROW_OR_FIREWORKFields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTHFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic floatgetPowerForTime(int charge) Gets the velocity of the arrow entity from the bow's chargegetUseAnimation(ItemStack stack) Returns the action that specifies what animation to play when the item is being used.intgetUseDuration(ItemStack stack, LivingEntity entity) voidreleaseUsing(ItemStack stack, Level level, LivingEntity entityLiving, int timeLeft) Called when the player stops using an Item (stops holding the right mouse button).protected voidshootProjectile(LivingEntity shooter, Projectile projectile, int index, float velocity, float inaccuracy, float angle, LivingEntity target) use(Level level, Player player, InteractionHand hand) Called to trigger the item's "innate" right click behavior.Methods inherited from class net.minecraft.world.item.ProjectileWeaponItem
createProjectile, customArrow, draw, getAllSupportedProjectiles, getDefaultCreativeAmmo, getDurabilityUse, getEnchantmentValue, getHeldProjectile, getSupportedHeldProjectiles, getSupportedHeldProjectiles, shoot, useAmmoMethods 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, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, requiredFeatures, toString, useOn, useOnRelease, verifyComponentsAfterLoadMethods 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, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
Field Details
-
MAX_DRAW_DURATION
public static final int MAX_DRAW_DURATION- See Also:
-
DEFAULT_RANGE
public static final int DEFAULT_RANGE- See Also:
-
-
Constructor Details
-
BowItem
-
-
Method Details
-
releaseUsing
Called when the player stops using an Item (stops holding the right mouse button).- Overrides:
releaseUsingin classItem
-
shootProjectile
protected void shootProjectile(LivingEntity shooter, Projectile projectile, int index, float velocity, float inaccuracy, float angle, @Nullable LivingEntity target) - Specified by:
shootProjectilein classProjectileWeaponItem
-
getPowerForTime
public static float getPowerForTime(int charge) Gets the velocity of the arrow entity from the bow's charge -
getUseDuration
- Overrides:
getUseDurationin classItem
-
getUseAnimation
Returns the action that specifies what animation to play when the item is being used.- Overrides:
getUseAnimationin classItem
-
use
Called to trigger the item's "innate" right click behavior. To handle when this item is used on a Block, see.invalid reference
#onItemUse -
getAllSupportedProjectiles
- Specified by:
getAllSupportedProjectilesin classProjectileWeaponItem
-
getDefaultProjectileRange
public int getDefaultProjectileRange()- Specified by:
getDefaultProjectileRangein classProjectileWeaponItem
-