Package net.minecraft.world.item
Class CrossbowItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ProjectileWeaponItem
net.minecraft.world.item.CrossbowItem
- 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
Modifier and TypeFieldDescriptionprivate static final float
static final int
private static final CrossbowItem.ChargingSounds
private static final float
private static final float
private static final float
private boolean
static final float
private static final float
private boolean
Fields inherited from class net.minecraft.world.item.ProjectileWeaponItem
ARROW_ONLY, ARROW_OR_FIREWORK
Fields 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_WIDTH
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendHoverText
(ItemStack p_40880_, Item.TooltipContext p_339686_, List<Component> p_40882_, TooltipFlag p_40883_) protected Projectile
createProjectile
(Level p_331583_, LivingEntity p_40863_, ItemStack p_40864_, ItemStack p_40865_, boolean p_40866_) static int
getChargeDuration
(ItemStack p_352255_, LivingEntity p_345687_) (package private) CrossbowItem.ChargingSounds
getChargingSounds
(ItemStack p_345050_) int
protected int
getDurabilityUse
(ItemStack p_331489_) private static float
getPowerForTime
(int p_40854_, ItemStack p_40855_, LivingEntity p_344803_) private static org.joml.Vector3f
getProjectileShotVector
(LivingEntity p_331584_, Vec3 p_331590_, float p_331104_) private static float
getRandomShotPitch
(boolean p_220026_, RandomSource p_220027_) private static float
getShootingPower
(ChargedProjectiles p_330249_) private static float
getShotPitch
(RandomSource p_331176_, int p_331542_) getUseAnimation
(ItemStack p_40935_) int
getUseDuration
(ItemStack p_40938_, LivingEntity p_344898_) static boolean
void
onUseTick
(Level p_40910_, LivingEntity p_40911_, ItemStack p_40912_, int p_40913_) void
performShooting
(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_, LivingEntity p_331602_) void
releaseUsing
(ItemStack p_40875_, Level p_40876_, LivingEntity p_40877_, int p_40878_) protected void
shootProjectile
(LivingEntity p_40896_, Projectile p_332122_, int p_331865_, float p_40900_, float p_40902_, float p_40903_, LivingEntity p_330303_) 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
customArrow, draw, getDefaultCreativeAmmo, getEnchantmentValue, getHeldProjectile, shoot, useAmmo
Methods inherited from class net.minecraft.world.item.Item
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, getRenderPropertiesInternal, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, requiredFeatures, toString, useOn, verifyComponentsAfterLoad
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
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, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
MAX_CHARGE_DURATION
private static final float 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:
-
MOB_ARROW_POWER
public static final float MOB_ARROW_POWER- See Also:
-
DEFAULT_SOUNDS
-
-
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
-
isCharged
-
shootProjectile
protected void shootProjectile(LivingEntity p_40896_, Projectile p_332122_, int p_331865_, float p_40900_, float p_40902_, float p_40903_, @Nullable LivingEntity p_330303_) - Specified by:
shootProjectile
in classProjectileWeaponItem
-
getProjectileShotVector
private static org.joml.Vector3f getProjectileShotVector(LivingEntity p_331584_, Vec3 p_331590_, float p_331104_) -
createProjectile
protected Projectile createProjectile(Level p_331583_, LivingEntity p_40863_, ItemStack p_40864_, ItemStack p_40865_, boolean p_40866_) - Overrides:
createProjectile
in classProjectileWeaponItem
-
getDurabilityUse
- Overrides:
getDurabilityUse
in classProjectileWeaponItem
-
performShooting
public void performShooting(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_, @Nullable LivingEntity p_331602_) -
getShotPitch
-
getRandomShotPitch
-
onUseTick
-
getUseDuration
- Overrides:
getUseDuration
in classItem
-
getChargeDuration
-
getUseAnimation
- Overrides:
getUseAnimation
in classItem
-
getChargingSounds
-
getPowerForTime
-
appendHoverText
public void appendHoverText(ItemStack p_40880_, Item.TooltipContext p_339686_, 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
-