Package net.minecraft.world.item
Class CrossbowItem
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<Item>
net.minecraft.world.item.Item
net.minecraft.world.item.ProjectileWeaponItem
net.minecraft.world.item.CrossbowItem
- All Implemented Interfaces:
Vanishable,ItemLike,IForgeItem,IForgeRegistryEntry<Item>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.PropertiesNested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatstatic final intprivate static final floatprivate static final intprivate static final floatprivate booleanprivate static final floatprivate booleanprivate static final Stringprivate static final StringFields inherited from class net.minecraft.world.item.ProjectileWeaponItem
ARROW_ONLY, ARROW_OR_FIREWORKFields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, category, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZEFields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddChargedProjectile(ItemStack p_40929_, ItemStack p_40930_) voidappendHoverText(ItemStack p_40880_, Level p_40881_, List<Component> p_40882_, TooltipFlag p_40883_) private static voidclearChargedProjectiles(ItemStack p_40944_) static booleancontainsChargedProjectile(ItemStack p_40872_, Item p_40873_) private static AbstractArrowgetArrow(Level p_40915_, LivingEntity p_40916_, ItemStack p_40917_, ItemStack p_40918_) getChargedProjectiles(ItemStack p_40942_) static intgetChargeDuration(ItemStack p_40940_) intprivate static floatgetPowerForTime(int p_40854_, ItemStack p_40855_) private static floatgetRandomShotPitch(boolean p_150798_, Random p_150799_) private static floatgetShootingPower(ItemStack p_40946_) private static float[]getShotPitches(Random p_40924_) private SoundEventgetStartSound(int p_40852_) getUseAnimation(ItemStack p_40935_) intgetUseDuration(ItemStack p_40938_) static booleanprivate static booleanloadProjectile(LivingEntity p_40863_, ItemStack p_40864_, ItemStack p_40865_, boolean p_40866_, boolean p_40867_) private static voidonCrossbowShot(Level p_40906_, LivingEntity p_40907_, ItemStack p_40908_) voidonUseTick(Level p_40910_, LivingEntity p_40911_, ItemStack p_40912_, int p_40913_) static voidperformShooting(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_) voidreleaseUsing(ItemStack p_40875_, Level p_40876_, LivingEntity p_40877_, int p_40878_) static voidsetCharged(ItemStack p_40885_, boolean p_40886_) private static voidshootProjectile(Level p_40895_, LivingEntity p_40896_, InteractionHand p_40897_, ItemStack p_40898_, ItemStack p_40899_, float p_40900_, boolean p_40901_, float p_40902_, float p_40903_, float p_40904_) private static booleantryLoadProjectiles(LivingEntity p_40860_, ItemStack p_40861_) use(Level p_40920_, Player p_40921_, InteractionHand p_40922_) booleanuseOnRelease(ItemStack p_150801_) Methods inherited from class net.minecraft.world.item.ProjectileWeaponItem
getEnchantmentValue, getHeldProjectileMethods inherited from class net.minecraft.world.item.Item
allowdedIn, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, fillItemCategory, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEquipSound, getFoodProperties, getId, getItemCategory, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, shouldOverrideMultiplayerNbt, toString, useOn, verifyTagAfterLoadMethods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getShareTag, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
TAG_CHARGED
- See Also:
-
TAG_CHARGED_PROJECTILES
- See Also:
-
MAX_CHARGE_DURATION
private static final int MAX_CHARGE_DURATION- See Also:
-
DEFAULT_RANGE
public static final int DEFAULT_RANGE- See Also:
-
startSoundPlayed
private boolean startSoundPlayed -
midLoadSoundPlayed
private boolean midLoadSoundPlayed -
START_SOUND_PERCENT
private static final float START_SOUND_PERCENT- See Also:
-
MID_SOUND_PERCENT
private static final float MID_SOUND_PERCENT- See Also:
-
ARROW_POWER
private static final float ARROW_POWER- See Also:
-
FIREWORK_POWER
private static final float FIREWORK_POWER- See Also:
-
-
Constructor Details
-
CrossbowItem
-
-
Method Details
-
getSupportedHeldProjectiles
- Overrides:
getSupportedHeldProjectilesin classProjectileWeaponItem
-
getAllSupportedProjectiles
- Specified by:
getAllSupportedProjectilesin classProjectileWeaponItem
-
use
public InteractionResultHolder<ItemStack> use(Level p_40920_, Player p_40921_, InteractionHand p_40922_) -
getShootingPower
-
releaseUsing
- Overrides:
releaseUsingin classItem
-
tryLoadProjectiles
-
loadProjectile
private static boolean loadProjectile(LivingEntity p_40863_, ItemStack p_40864_, ItemStack p_40865_, boolean p_40866_, boolean p_40867_) -
isCharged
-
setCharged
-
addChargedProjectile
-
getChargedProjectiles
-
clearChargedProjectiles
-
containsChargedProjectile
-
shootProjectile
private static void shootProjectile(Level p_40895_, LivingEntity p_40896_, InteractionHand p_40897_, ItemStack p_40898_, ItemStack p_40899_, float p_40900_, boolean p_40901_, float p_40902_, float p_40903_, float p_40904_) -
getArrow
private static AbstractArrow getArrow(Level p_40915_, LivingEntity p_40916_, ItemStack p_40917_, ItemStack p_40918_) -
performShooting
public static void performShooting(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_) -
getShotPitches
-
getRandomShotPitch
-
onCrossbowShot
-
onUseTick
-
getUseDuration
- Overrides:
getUseDurationin classItem
-
getChargeDuration
-
getUseAnimation
- Overrides:
getUseAnimationin classItem
-
getStartSound
-
getPowerForTime
-
appendHoverText
public void appendHoverText(ItemStack p_40880_, @Nullable Level p_40881_, List<Component> p_40882_, TooltipFlag p_40883_) - Overrides:
appendHoverTextin classItem
-
useOnRelease
- Overrides:
useOnReleasein classItem
-
getDefaultProjectileRange
public int getDefaultProjectileRange()- Specified by:
getDefaultProjectileRangein classProjectileWeaponItem
-