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.Properties
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static float
static int
private static float
private static int
private static float
private boolean
private static float
private boolean
private static String
private static String
Fields inherited from class net.minecraft.world.item.ProjectileWeaponItem
ARROW_ONLY, ARROW_OR_FIREWORK
Fields 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_SIZE
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addChargedProjectile(ItemStack p_40929_, ItemStack p_40930_)
void
appendHoverText(ItemStack p_40880_, Level p_40881_, List<Component> p_40882_, TooltipFlag p_40883_)
private static void
clearChargedProjectiles(ItemStack p_40944_)
static boolean
containsChargedProjectile(ItemStack p_40872_, Item p_40873_)
private static AbstractArrow
getArrow(Level p_40915_, LivingEntity p_40916_, ItemStack p_40917_, ItemStack p_40918_)
getChargedProjectiles(ItemStack p_40942_)
static int
getChargeDuration(ItemStack p_40940_)
int
private static float
getPowerForTime(int p_40854_, ItemStack p_40855_)
private static float
getRandomShotPitch(boolean p_150798_, Random p_150799_)
private static float
getShootingPower(ItemStack p_40946_)
private static float[]
getShotPitches(Random p_40924_)
private SoundEvent
getStartSound(int p_40852_)
getUseAnimation(ItemStack p_40935_)
int
getUseDuration(ItemStack p_40938_)
static boolean
private static boolean
loadProjectile(LivingEntity p_40863_, ItemStack p_40864_, ItemStack p_40865_, boolean p_40866_, boolean p_40867_)
private static void
onCrossbowShot(Level p_40906_, LivingEntity p_40907_, ItemStack p_40908_)
void
onUseTick(Level p_40910_, LivingEntity p_40911_, ItemStack p_40912_, int p_40913_)
static void
performShooting(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_)
void
releaseUsing(ItemStack p_40875_, Level p_40876_, LivingEntity p_40877_, int p_40878_)
static void
setCharged(ItemStack p_40885_, boolean p_40886_)
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_)
private static boolean
tryLoadProjectiles(LivingEntity p_40860_, ItemStack p_40861_)
use(Level p_40920_, Player p_40921_, InteractionHand p_40922_)
boolean
useOnRelease(ItemStack p_150801_)
Methods inherited from class net.minecraft.world.item.ProjectileWeaponItem
getEnchantmentValue, getHeldProjectile
Methods inherited from class net.minecraft.world.item.Item
allowdedIn, asItem, 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, getTags, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, shouldOverrideMultiplayerNbt, toString, useOn, verifyTagAfterLoad
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
-
Field Details
-
TAG_CHARGED
- See Also:
- Constant Field Values
-
TAG_CHARGED_PROJECTILES
- See Also:
- Constant Field Values
-
MAX_CHARGE_DURATION
private static final int MAX_CHARGE_DURATION- See Also:
- Constant Field Values
-
DEFAULT_RANGE
public static final int DEFAULT_RANGE- See Also:
- Constant Field Values
-
startSoundPlayed
private boolean startSoundPlayed -
midLoadSoundPlayed
private boolean midLoadSoundPlayed -
START_SOUND_PERCENT
private static final float START_SOUND_PERCENT- See Also:
- Constant Field Values
-
MID_SOUND_PERCENT
private static final float MID_SOUND_PERCENT- See Also:
- Constant Field Values
-
ARROW_POWER
private static final float ARROW_POWER- See Also:
- Constant Field Values
-
FIREWORK_POWER
private static final float FIREWORK_POWER- See Also:
- Constant Field Values
-
-
Constructor Details
-
CrossbowItem
-
-
Method Details
-
getSupportedHeldProjectiles
- Overrides:
getSupportedHeldProjectiles
in classProjectileWeaponItem
-
getAllSupportedProjectiles
- Specified by:
getAllSupportedProjectiles
in classProjectileWeaponItem
-
use
public InteractionResultHolder<ItemStack> use(Level p_40920_, Player p_40921_, InteractionHand p_40922_) -
getShootingPower
-
releaseUsing
- Overrides:
releaseUsing
in 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:
getUseDuration
in classItem
-
getChargeDuration
-
getUseAnimation
- Overrides:
getUseAnimation
in classItem
-
getStartSound
-
getPowerForTime
-
appendHoverText
public void appendHoverText(ItemStack p_40880_, @Nullable Level p_40881_, List<Component> p_40882_, TooltipFlag p_40883_)- Overrides:
appendHoverText
in classItem
-
useOnRelease
- Overrides:
useOnRelease
in classItem
-
getDefaultProjectileRange
public int getDefaultProjectileRange()- Specified by:
getDefaultProjectileRange
in classProjectileWeaponItem
-