类 ProjectileWeaponItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ProjectileWeaponItem
- 所有已实现的接口:
FeatureElement
,ItemLike
,IItemExtension
- 直接已知子类:
BowItem
,CrossbowItem
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
字段概要
字段修饰符和类型字段说明从类继承的字段 net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, APPROXIMATELY_INFINITE_USE_DURATION, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canCombineRepair, CODEC, DEFAULT_MAX_STACK_SIZE, descriptionId, MAX_BAR_WIDTH, STREAM_CODEC
从接口继承的字段 net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected Projectile
createProjectile
(Level p_331008_, LivingEntity p_330781_, ItemStack p_330846_, ItemStack p_331497_, boolean p_331305_) customArrow
(AbstractArrow arrow, ItemStack projectileStack, ItemStack weaponStack) draw
(ItemStack p_331565_, ItemStack p_330406_, LivingEntity p_330823_) 已过时。Override this method if the allowed projectile is weapon stack dependent.getDefaultCreativeAmmo
(Player player, ItemStack projectileWeaponItem) Neo: Controls what ammo ItemStack that Creative Mode should return if the player has no valid ammo in inventory.abstract int
protected int
getDurabilityUse
(ItemStack p_331003_) static ItemStack
getHeldProjectile
(LivingEntity p_43011_, Predicate<ItemStack> p_43012_) 已过时。Use ItemStack sensitive versiongetSupportedHeldProjectiles(ItemStack)
Override this method if the weapon stack allows special projectile that would only be used if it's in hand.protected void
shoot
(ServerLevel p_346125_, LivingEntity p_330728_, InteractionHand p_331152_, ItemStack p_330646_, List<ItemStack> p_331726_, float p_331007_, float p_331445_, boolean p_331107_, LivingEntity p_331167_) protected abstract void
shootProjectile
(LivingEntity p_330966_, Projectile p_332201_, int p_331696_, float p_331444_, float p_331156_, float p_331718_, LivingEntity p_331705_) protected static ItemStack
useAmmo
(ItemStack p_331207_, ItemStack p_331434_, LivingEntity p_330302_, boolean p_330934_) 从类继承的方法 net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getCraftingRemainder, getDamageSource, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getName, getName, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hurtEnemy, interactLivingEntity, inventoryTick, isBarVisible, isCombineRepairable, isCorrectToolForDrops, isFoil, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, shouldPrintOpWarning, toString, use, useOn, useOnRelease, verifyComponentsAfterLoad
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraft.world.flag.FeatureElement
isEnabled
从接口继承的方法 net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, getAllEnchantments, getBurnTime, getCraftingRemainder, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEntityLifespan, getEquipmentSlot, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCustomEntity, isDamageable, isDamaged, isGazeDisguise, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
字段详细资料
-
ARROW_ONLY
-
ARROW_OR_FIREWORK
-
-
构造器详细资料
-
ProjectileWeaponItem
-
-
方法详细资料
-
getSupportedHeldProjectiles
已过时。Use ItemStack sensitive versiongetSupportedHeldProjectiles(ItemStack)
-
getAllSupportedProjectiles
已过时。Use ItemStack sensitive versiongetAllSupportedProjectiles(ItemStack)
-
getSupportedHeldProjectiles
Override this method if the weapon stack allows special projectile that would only be used if it's in hand. The default return value is a union-predicate ofgetAllSupportedProjectiles(ItemStack)
andgetSupportedHeldProjectiles()
- 参数:
stack
- The ProjectileWeapon stack- 返回:
- A predicate that returns true for supported projectile stack in hand
-
getAllSupportedProjectiles
Override this method if the allowed projectile is weapon stack dependent.- 参数:
stack
- The ProjectileWeapon stack- 返回:
- A predicate that returns true for all supported projectile stack
-
getHeldProjectile
-
getDefaultProjectileRange
public abstract int getDefaultProjectileRange() -
shoot
protected void shoot(ServerLevel p_346125_, LivingEntity p_330728_, InteractionHand p_331152_, ItemStack p_330646_, List<ItemStack> p_331726_, float p_331007_, float p_331445_, boolean p_331107_, @Nullable LivingEntity p_331167_) -
getDurabilityUse
-
shootProjectile
protected abstract void shootProjectile(LivingEntity p_330966_, Projectile p_332201_, int p_331696_, float p_331444_, float p_331156_, float p_331718_, @Nullable LivingEntity p_331705_) -
createProjectile
protected Projectile createProjectile(Level p_331008_, LivingEntity p_330781_, ItemStack p_330846_, ItemStack p_331497_, boolean p_331305_) -
draw
protected static List<ItemStack> draw(ItemStack p_331565_, ItemStack p_330406_, LivingEntity p_330823_) -
useAmmo
protected static ItemStack useAmmo(ItemStack p_331207_, ItemStack p_331434_, LivingEntity p_330302_, boolean p_330934_) -
customArrow
public AbstractArrow customArrow(AbstractArrow arrow, ItemStack projectileStack, ItemStack weaponStack) -
getDefaultCreativeAmmo
Neo: Controls what ammo ItemStack that Creative Mode should return if the player has no valid ammo in inventory. Modded weapons should override this to return their own ammo if they do not use vanilla arrows.- 参数:
player
- The player (if in context) firing the weaponprojectileWeaponItem
- The weapon ItemStack the ammo is for- 返回:
- The default ammo ItemStack for this weapon
-
getAllSupportedProjectiles(ItemStack)