net.minecraft.item

public class CrossbowItem

extends RangedWeaponItem

All mapped superinterfaces:

ItemConvertible, ToggleableFeature

net.minecraft.world.item.CrossbowItem
net.minecraft.world.item.CrossbowItem
net.minecraft.class_1764
net.minecraft.item.CrossbowItem

Field summary

Modifier and TypeField
private static final float
MAX_CHARGE_DURATION
MAX_CHARGE_DURATION
field_30866
DEFAULT_PULL_TIME
public static final int
DEFAULT_RANGE
DEFAULT_RANGE
field_30863
RANGE
private boolean
startSoundPlayed
startSoundPlayed
field_7937
charged
private boolean
midLoadSoundPlayed
midLoadSoundPlayed
field_7936
loaded
private static final float
START_SOUND_PERCENT
START_SOUND_PERCENT
field_30867
CHARGE_PROGRESS
private static final float
MID_SOUND_PERCENT
MID_SOUND_PERCENT
field_30868
LOAD_PROGRESS
private static final float
ARROW_POWER
ARROW_POWER
field_30869
DEFAULT_SPEED
private static final float
FIREWORK_POWER
FIREWORK_POWER
field_30870
FIREWORK_ROCKET_SPEED
public static final float
MOB_ARROW_POWER
MOB_ARROW_POWER
field_49258
field_49258
private static final CrossbowItem$LoadingSounds
DEFAULT_SOUNDS
DEFAULT_SOUNDS
field_51626
DEFAULT_LOADING_SOUNDS

Constructor summary

ModifierConstructor
public (Item$Settings properties)

Method summary

Modifier and TypeMethod
public Predicate<ItemStack>
getSupportedHeldProjectiles()
getSupportedHeldProjectiles()
method_20310()
getHeldProjectiles()
public Predicate<ItemStack>
getAllSupportedProjectiles()
getAllSupportedProjectiles()
method_19268()
getProjectiles()
public ActionResult
use(Level level, Player player, InteractionHand hand)
use(Level level, Player player, InteractionHand hand)
method_7836(class_1937 arg0, class_1657 arg1, class_1268 arg2)
use(World arg0, PlayerEntity arg1, Hand arg2)
private static float
getShootingPower(ChargedProjectiles projectiles)
getShootingPower(ChargedProjectiles projectiles)
method_20309(class_9278 arg0)
getSpeed(ChargedProjectilesComponent stack)
public boolean
releaseUsing(ItemStack itemStack, Level level, LivingEntity entity, int remainingTime)
releaseUsing(ItemStack itemStack, Level level, LivingEntity entity, int remainingTime)
method_7840(class_1799 arg0, class_1937 arg1, class_1309 arg2, int arg3)
onStoppedUsing(ItemStack arg0, World arg1, LivingEntity arg2, int arg3)
private static boolean
tryLoadProjectiles(LivingEntity shooter, ItemStack heldItem)
tryLoadProjectiles(LivingEntity shooter, ItemStack heldItem)
method_7767(class_1309 arg0, class_1799 arg1)
loadProjectiles(LivingEntity shooter, ItemStack crossbow)
public static boolean
isCharged(ItemStack itemStack)
isCharged(ItemStack itemStack)
method_7781(class_1799 arg0)
isCharged(ItemStack stack)
protected void
shootProjectile(LivingEntity livingEntity, Projectile projectileEntity, int index, float power, float uncertainty, float angle, LivingEntity targetOverride)
shootProjectile(LivingEntity livingEntity, Projectile projectileEntity, int index, float power, float uncertainty, float angle, LivingEntity targetOverride)
method_7763(class_1309 arg0, class_1676 arg1, int arg2, float arg3, float arg4, float arg5, class_1309 arg6)
shoot(LivingEntity arg0, ProjectileEntity arg1, int arg2, float arg3, float arg4, float arg5, LivingEntity arg6)
private static org.joml.Vector3f
getProjectileShotVector(LivingEntity body, Vec3 originalVector, float angle)
getProjectileShotVector(LivingEntity body, Vec3 originalVector, float angle)
method_57343(class_1309 arg0, class_243 arg1, float arg2)
calcVelocity(LivingEntity shooter, Vec3d direction, float yaw)
protected ProjectileEntity
createProjectile(Level level, LivingEntity shooter, ItemStack heldItem, ItemStack projectile, boolean isCrit)
createProjectile(Level level, LivingEntity shooter, ItemStack heldItem, ItemStack projectile, boolean isCrit)
method_57344(class_1937 arg0, class_1309 arg1, class_1799 arg2, class_1799 arg3, boolean arg4)
createArrowEntity(World arg0, LivingEntity arg1, ItemStack arg2, ItemStack arg3, boolean arg4)
protected int
getDurabilityUse(ItemStack projectile)
getDurabilityUse(ItemStack projectile)
method_57345(class_1799 arg0)
getWeaponStackDamage(ItemStack arg0)
public void
performShooting(Level level, LivingEntity shooter, InteractionHand hand, ItemStack weapon, float power, float uncertainty, LivingEntity targetOverride)
performShooting(Level level, LivingEntity shooter, InteractionHand hand, ItemStack weapon, float power, float uncertainty, LivingEntity targetOverride)
method_7777(class_1937 arg0, class_1309 arg1, class_1268 arg2, class_1799 arg3, float arg4, float arg5, class_1309 arg6)
shootAll(World world, LivingEntity shooter, Hand hand, ItemStack stack, float speed, float divergence, LivingEntity target)
private static float
getShotPitch(RandomSource random, int index)
getShotPitch(RandomSource random, int index)
method_57342(class_5819 arg0, int arg1)
getSoundPitch(Random random, int index)
private static float
getRandomShotPitch(boolean highPitch, RandomSource random)
getRandomShotPitch(boolean highPitch, RandomSource random)
method_7784(boolean arg0, class_5819 arg1)
getSoundPitch(boolean flag, Random random)
public void
onUseTick(Level level, LivingEntity entity, ItemStack itemStack, int ticksRemaining)
onUseTick(Level level, LivingEntity entity, ItemStack itemStack, int ticksRemaining)
method_7852(class_1937 arg0, class_1309 arg1, class_1799 arg2, int arg3)
usageTick(World arg0, LivingEntity arg1, ItemStack arg2, int arg3)
public int
getUseDuration(ItemStack itemStack, LivingEntity user)
getUseDuration(ItemStack itemStack, LivingEntity user)
method_7881(class_1799 arg0, class_1309 arg1)
getMaxUseTime(ItemStack arg0, LivingEntity arg1)
public static int
getChargeDuration(ItemStack crossbow, LivingEntity user)
getChargeDuration(ItemStack crossbow, LivingEntity user)
method_7775(class_1799 arg0, class_1309 arg1)
getPullTime(ItemStack stack, LivingEntity user)
public UseAction
getUseAnimation(ItemStack itemStack)
getUseAnimation(ItemStack itemStack)
method_7853(class_1799 arg0)
getUseAction(ItemStack arg0)
CrossbowItem$LoadingSounds
getChargingSounds(ItemStack itemStack)
getChargingSounds(ItemStack itemStack)
method_59976(class_1799 arg0)
getLoadingSounds(ItemStack stack)
private static float
getPowerForTime(int timeHeld, ItemStack itemStack, LivingEntity holder)
getPowerForTime(int timeHeld, ItemStack itemStack, LivingEntity holder)
method_7770(int arg0, class_1799 arg1, class_1309 arg2)
getPullProgress(int useTicks, ItemStack stack, LivingEntity user)
public boolean
useOnRelease(ItemStack itemStack)
useOnRelease(ItemStack itemStack)
method_7838(class_1799 arg0)
isUsedOnRelease(ItemStack arg0)
public int
getDefaultProjectileRange()
getDefaultProjectileRange()
method_24792()
getRange()