Package net.minecraft.item
Class CrossbowItem
- java.lang.Object
-
- net.minecraftforge.registries.ForgeRegistryEntry<Item>
-
- net.minecraft.item.Item
-
- net.minecraft.item.ShootableItem
-
- net.minecraft.item.CrossbowItem
-
- All Implemented Interfaces:
IVanishable
,IItemProvider
,IForgeItem
,IForgeRegistryEntry<Item>
public class CrossbowItem extends ShootableItem implements IVanishable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Properties
-
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
midLoadSoundPlayed
private boolean
startSoundPlayed
-
Fields inherited from class net.minecraft.item.ShootableItem
ARROW_ONLY, ARROW_OR_FIREWORK
-
Fields inherited from class net.minecraft.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, category, random
-
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
-
Constructor Summary
Constructors Constructor Description CrossbowItem(Item.Properties p_i50052_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addChargedProjectile(ItemStack p_220029_0_, ItemStack p_220029_1_)
void
appendHoverText(ItemStack p_77624_1_, World p_77624_2_, java.util.List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_)
private static void
clearChargedProjectiles(ItemStack p_220027_0_)
static boolean
containsChargedProjectile(ItemStack p_220019_0_, Item p_220019_1_)
java.util.function.Predicate<ItemStack>
getAllSupportedProjectiles()
private static AbstractArrowEntity
getArrow(World p_220024_0_, LivingEntity p_220024_1_, ItemStack p_220024_2_, ItemStack p_220024_3_)
private static java.util.List<ItemStack>
getChargedProjectiles(ItemStack p_220018_0_)
static int
getChargeDuration(ItemStack p_220026_0_)
int
getDefaultProjectileRange()
private static float
getPowerForTime(int p_220031_0_, ItemStack p_220031_1_)
private static float
getRandomShotPitch(boolean p_220032_0_)
private static float
getShootingPower(ItemStack p_220013_0_)
private static float[]
getShotPitches(java.util.Random p_220028_0_)
private SoundEvent
getStartSound(int p_220025_1_)
java.util.function.Predicate<ItemStack>
getSupportedHeldProjectiles()
UseAction
getUseAnimation(ItemStack p_77661_1_)
int
getUseDuration(ItemStack p_77626_1_)
static boolean
isCharged(ItemStack p_220012_0_)
private static boolean
loadProjectile(LivingEntity p_220023_0_, ItemStack p_220023_1_, ItemStack p_220023_2_, boolean p_220023_3_, boolean p_220023_4_)
private static void
onCrossbowShot(World p_220015_0_, LivingEntity p_220015_1_, ItemStack p_220015_2_)
void
onUseTick(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_)
static void
performShooting(World p_220014_0_, LivingEntity p_220014_1_, Hand p_220014_2_, ItemStack p_220014_3_, float p_220014_4_, float p_220014_5_)
void
releaseUsing(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_)
static void
setCharged(ItemStack p_220011_0_, boolean p_220011_1_)
private static void
shootProjectile(World p_220016_0_, LivingEntity p_220016_1_, Hand p_220016_2_, ItemStack p_220016_3_, ItemStack p_220016_4_, float p_220016_5_, boolean p_220016_6_, float p_220016_7_, float p_220016_8_, float p_220016_9_)
private static boolean
tryLoadProjectiles(LivingEntity p_220021_0_, ItemStack p_220021_1_)
ActionResult<ItemStack>
use(World p_77659_1_, PlayerEntity p_77659_2_, Hand p_77659_3_)
-
Methods inherited from class net.minecraft.item.ShootableItem
getEnchantmentValue, getHeldProjectile
-
Methods inherited from class net.minecraft.item.Item
allowdedIn, asItem, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, fillItemCategory, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getFoodProperties, getHarvestLevel, getId, getItemCategory, getItemStackTileEntityRenderer, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getTags, getToolTypes, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, inventoryTick, is, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, shouldOverrideMultiplayerNbt, toString, useOn, useOnRelease, 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, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
-
-
-
-
Constructor Detail
-
CrossbowItem
public CrossbowItem(Item.Properties p_i50052_1_)
-
-
Method Detail
-
getSupportedHeldProjectiles
public java.util.function.Predicate<ItemStack> getSupportedHeldProjectiles()
- Overrides:
getSupportedHeldProjectiles
in classShootableItem
-
getAllSupportedProjectiles
public java.util.function.Predicate<ItemStack> getAllSupportedProjectiles()
- Specified by:
getAllSupportedProjectiles
in classShootableItem
-
use
public ActionResult<ItemStack> use(World p_77659_1_, PlayerEntity p_77659_2_, Hand p_77659_3_)
-
releaseUsing
public void releaseUsing(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_)
- Overrides:
releaseUsing
in classItem
-
tryLoadProjectiles
private static boolean tryLoadProjectiles(LivingEntity p_220021_0_, ItemStack p_220021_1_)
-
loadProjectile
private static boolean loadProjectile(LivingEntity p_220023_0_, ItemStack p_220023_1_, ItemStack p_220023_2_, boolean p_220023_3_, boolean p_220023_4_)
-
isCharged
public static boolean isCharged(ItemStack p_220012_0_)
-
setCharged
public static void setCharged(ItemStack p_220011_0_, boolean p_220011_1_)
-
addChargedProjectile
private static void addChargedProjectile(ItemStack p_220029_0_, ItemStack p_220029_1_)
-
getChargedProjectiles
private static java.util.List<ItemStack> getChargedProjectiles(ItemStack p_220018_0_)
-
clearChargedProjectiles
private static void clearChargedProjectiles(ItemStack p_220027_0_)
-
containsChargedProjectile
public static boolean containsChargedProjectile(ItemStack p_220019_0_, Item p_220019_1_)
-
shootProjectile
private static void shootProjectile(World p_220016_0_, LivingEntity p_220016_1_, Hand p_220016_2_, ItemStack p_220016_3_, ItemStack p_220016_4_, float p_220016_5_, boolean p_220016_6_, float p_220016_7_, float p_220016_8_, float p_220016_9_)
-
getArrow
private static AbstractArrowEntity getArrow(World p_220024_0_, LivingEntity p_220024_1_, ItemStack p_220024_2_, ItemStack p_220024_3_)
-
performShooting
public static void performShooting(World p_220014_0_, LivingEntity p_220014_1_, Hand p_220014_2_, ItemStack p_220014_3_, float p_220014_4_, float p_220014_5_)
-
getShotPitches
private static float[] getShotPitches(java.util.Random p_220028_0_)
-
getRandomShotPitch
private static float getRandomShotPitch(boolean p_220032_0_)
-
onCrossbowShot
private static void onCrossbowShot(World p_220015_0_, LivingEntity p_220015_1_, ItemStack p_220015_2_)
-
onUseTick
public void onUseTick(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_)
-
getUseDuration
public int getUseDuration(ItemStack p_77626_1_)
- Overrides:
getUseDuration
in classItem
-
getChargeDuration
public static int getChargeDuration(ItemStack p_220026_0_)
-
getUseAnimation
public UseAction getUseAnimation(ItemStack p_77661_1_)
- Overrides:
getUseAnimation
in classItem
-
getStartSound
private SoundEvent getStartSound(int p_220025_1_)
-
getPowerForTime
private static float getPowerForTime(int p_220031_0_, ItemStack p_220031_1_)
-
appendHoverText
public void appendHoverText(ItemStack p_77624_1_, @Nullable World p_77624_2_, java.util.List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_)
- Overrides:
appendHoverText
in classItem
-
getShootingPower
private static float getShootingPower(ItemStack p_220013_0_)
-
getDefaultProjectileRange
public int getDefaultProjectileRange()
- Specified by:
getDefaultProjectileRange
in classShootableItem
-
-