Package net.minecraft.item
Class BowItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.RangedWeaponItem
net.minecraft.item.BowItem
- All Implemented Interfaces:
ItemConvertible
,Vanishable
public class BowItem extends RangedWeaponItem implements Vanishable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings
-
Field Summary
Fields inherited from class net.minecraft.item.RangedWeaponItem
BOW_PROJECTILES, CROSSBOW_HELD_PROJECTILES
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
-
Constructor Summary
Constructors Constructor Description BowItem(Item.Settings settings)
-
Method Summary
Modifier and Type Method Description int
getMaxUseTime(ItemStack stack)
Predicate<ItemStack>
getProjectiles()
static float
getPullProgress(int useTicks)
int
getRange()
UseAction
getUseAction(ItemStack stack)
void
onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks)
TypedActionResult<ItemStack>
use(World world, PlayerEntity user, Hand hand)
Called when an item is used by a player.Methods inherited from class net.minecraft.item.RangedWeaponItem
getEnchantability, getHeldProjectile, getHeldProjectiles
Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, useOnBlock, useOnEntity
-
Constructor Details
-
BowItem
-
-
Method Details
-
onStoppedUsing
- Overrides:
onStoppedUsing
in classItem
-
getPullProgress
public static float getPullProgress(int useTicks) -
getMaxUseTime
- Overrides:
getMaxUseTime
in classItem
-
getUseAction
- Overrides:
getUseAction
in classItem
-
use
Called when an item is used by a player. The use action, by default, is bound to the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient()
.- Overrides:
use
in classItem
- Parameters:
world
- the world the item was used inuser
- the player who used the itemhand
- the hand used- Returns:
- a typed action result that specifies whether using the item was successful. The action result contains the new item stack that the player's hand will be set to.
-
getProjectiles
- Specified by:
getProjectiles
in classRangedWeaponItem
-
getRange
public int getRange()- Specified by:
getRange
in classRangedWeaponItem
-