public class CrossbowItem extends ShootableItem
Item.Properties
Modifier and Type | Field and Description |
---|---|
private boolean |
isLoadingMiddle |
private boolean |
isLoadingStart |
ARROWS, ARROWS_OR_FIREWORKS
ATTACK_DAMAGE_MODIFIER, ATTACK_SPEED_MODIFIER, BLOCK_TO_ITEM, canRepair, group, properties, random
delegate
Constructor and Description |
---|
CrossbowItem(Item.Properties propertiesIn) |
Modifier and Type | Method and Description |
---|---|
private static void |
addChargedProjectile(ItemStack crossbow,
ItemStack projectile) |
void |
addInformation(ItemStack stack,
World worldIn,
java.util.List<ITextComponent> tooltip,
ITooltipFlag flagIn) |
private static void |
clearProjectiles(ItemStack stack) |
private static AbstractArrowEntity |
createArrow(World worldIn,
LivingEntity shooter,
ItemStack crossbow,
ItemStack ammo) |
private static void |
fireProjectile(World worldIn,
LivingEntity shooter,
Hand handIn,
ItemStack crossbow,
ItemStack projectile,
float soundPitch,
boolean isCreativeMode,
float velocity,
float inaccuracy,
float projectileAngle) |
static void |
fireProjectiles(World worldIn,
LivingEntity shooter,
Hand handIn,
ItemStack stack,
float velocityIn,
float inaccuracyIn) |
private static void |
fireProjectilesAfter(World worldIn,
LivingEntity shooter,
ItemStack stack) |
private static float |
func_220013_l(ItemStack p_220013_0_) |
private static boolean |
func_220023_a(LivingEntity p_220023_0_,
ItemStack p_220023_1_,
ItemStack p_220023_2_,
boolean p_220023_3_,
boolean p_220023_4_) |
java.util.function.Predicate<ItemStack> |
getAmmoPredicate() |
private static float |
getCharge(int useTime,
ItemStack stack) |
private static java.util.List<ItemStack> |
getChargedProjectiles(ItemStack stack) |
static int |
getChargeTime(ItemStack stack) |
java.util.function.Predicate<ItemStack> |
getInventoryAmmoPredicate() |
private static float |
getRandomSoundPitch(boolean flagIn) |
private static float[] |
getRandomSoundPitches(java.util.Random rand) |
private SoundEvent |
getSoundEvent(int enchantmentLevel) |
UseAction |
getUseAction(ItemStack stack) |
int |
getUseDuration(ItemStack stack) |
private static boolean |
hasAmmo(LivingEntity entityIn,
ItemStack stack) |
private static boolean |
hasChargedProjectile(ItemStack stack,
Item ammoItem) |
static boolean |
isCharged(ItemStack stack) |
ActionResult<ItemStack> |
onItemRightClick(World worldIn,
PlayerEntity playerIn,
Hand handIn) |
void |
onPlayerStoppedUsing(ItemStack stack,
World worldIn,
LivingEntity entityLiving,
int timeLeft) |
void |
onUse(World worldIn,
LivingEntity livingEntityIn,
ItemStack stack,
int count) |
static void |
setCharged(ItemStack stack,
boolean chargedIn) |
getHeldAmmo, getItemEnchantability
addPropertyOverride, asItem, canHarvestBlock, canPlayerBreakBlockWhileHolding, fillItemGroup, getAttributeModifiers, getContainerItem, getDefaultInstance, getDefaultTranslationKey, getDestroySpeed, getDisplayName, getDrinkSound, getEatSound, getFood, getGroup, getHarvestLevel, getIdFromItem, getIsRepairable, getItemById, getItemFromBlock, getItemStackTileEntityRenderer, getMaxDamage, getMaxStackSize, getName, getPropertyGetter, getRarity, getTags, getToolTypes, getTranslationKey, getTranslationKey, hasContainerItem, hasCustomProperties, hasEffect, hitEntity, inventoryTick, isComplex, isCrossbow, isDamageable, isEnchantable, isFood, isIn, isInGroup, isRepairable, itemInteractionForEntity, onBlockDestroyed, onCreated, onItemUse, onItemUseFinish, rayTrace, shouldSyncTag, toString, updateItemStackNBT
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAnimationParameters, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBeaconPayment, isBookEnchantable, isDamaged, isShield, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
private boolean isLoadingStart
private boolean isLoadingMiddle
public CrossbowItem(Item.Properties propertiesIn)
public java.util.function.Predicate<ItemStack> getAmmoPredicate()
getAmmoPredicate
in class ShootableItem
public java.util.function.Predicate<ItemStack> getInventoryAmmoPredicate()
getInventoryAmmoPredicate
in class ShootableItem
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn)
onItemRightClick
in class Item
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int timeLeft)
onPlayerStoppedUsing
in class Item
private static boolean hasAmmo(LivingEntity entityIn, ItemStack stack)
private static boolean func_220023_a(LivingEntity p_220023_0_, ItemStack p_220023_1_, ItemStack p_220023_2_, boolean p_220023_3_, boolean p_220023_4_)
public static boolean isCharged(ItemStack stack)
public static void setCharged(ItemStack stack, boolean chargedIn)
private static void addChargedProjectile(ItemStack crossbow, ItemStack projectile)
private static java.util.List<ItemStack> getChargedProjectiles(ItemStack stack)
private static void clearProjectiles(ItemStack stack)
private static void fireProjectile(World worldIn, LivingEntity shooter, Hand handIn, ItemStack crossbow, ItemStack projectile, float soundPitch, boolean isCreativeMode, float velocity, float inaccuracy, float projectileAngle)
private static AbstractArrowEntity createArrow(World worldIn, LivingEntity shooter, ItemStack crossbow, ItemStack ammo)
public static void fireProjectiles(World worldIn, LivingEntity shooter, Hand handIn, ItemStack stack, float velocityIn, float inaccuracyIn)
private static float[] getRandomSoundPitches(java.util.Random rand)
private static float getRandomSoundPitch(boolean flagIn)
private static void fireProjectilesAfter(World worldIn, LivingEntity shooter, ItemStack stack)
public void onUse(World worldIn, LivingEntity livingEntityIn, ItemStack stack, int count)
public int getUseDuration(ItemStack stack)
getUseDuration
in class Item
public static int getChargeTime(ItemStack stack)
public UseAction getUseAction(ItemStack stack)
getUseAction
in class Item
private SoundEvent getSoundEvent(int enchantmentLevel)
private static float getCharge(int useTime, ItemStack stack)
public void addInformation(ItemStack stack, @Nullable World worldIn, java.util.List<ITextComponent> tooltip, ITooltipFlag flagIn)
addInformation
in class Item
private static float func_220013_l(ItemStack p_220013_0_)