Package net.minecraft.item
Class RangedWeaponItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.RangedWeaponItem
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
BowItem
,CrossbowItem
public abstract class RangedWeaponItem extends Item
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings
-
Field Summary
Fields Modifier and Type Field Description static Predicate<ItemStack>
BOW_PROJECTILES
static Predicate<ItemStack>
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 RangedWeaponItem(Item.Settings settings)
-
Method Summary
Modifier and Type Method Description int
getEnchantability()
Gets the enchantability of an item.static ItemStack
getHeldProjectile(LivingEntity entity, Predicate<ItemStack> predicate)
Predicate<ItemStack>
getHeldProjectiles()
abstract Predicate<ItemStack>
getProjectiles()
abstract int
getRange()
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, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnBlock, useOnEntity
-
Field Details
-
BOW_PROJECTILES
-
CROSSBOW_HELD_PROJECTILES
-
-
Constructor Details
-
RangedWeaponItem
-
-
Method Details
-
getHeldProjectiles
-
getProjectiles
-
getHeldProjectile
-
getEnchantability
public int getEnchantability()Gets the enchantability of an item. This specifies the ability of an item to receive enchantments when enchanted using an enchanting table. As the value increases, the amount and level of enchantments applied increase.If the value of this method is 0, the item cannot be enchanted using an enchanting table.
- Overrides:
getEnchantability
in classItem
-
getRange
public abstract int getRange()
-