Package net.minecraft.world.item
Class SwordItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.TieredItem
net.minecraft.world.item.SwordItem
- All Implemented Interfaces:
- FeatureElement,- Vanishable,- ItemLike,- IForgeItem
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.world.item.ItemItem.Properties
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final floatprivate final com.google.common.collect.Multimap<Attribute,AttributeModifier> Fields inherited from class net.minecraft.world.item.ItemBASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZEFields inherited from interface net.minecraft.world.flag.FeatureElementFILTERED_REGISTRIES
- 
Constructor SummaryConstructorsConstructorDescriptionSwordItem(Tier p_43269_, int p_43270_, float p_43271_, Item.Properties p_43272_) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanAttackBlock(BlockState p_43291_, Level p_43292_, BlockPos p_43293_, Player p_43294_) booleancanPerformAction(ItemStack stack, ToolAction toolAction) Queries if an item can perform the given action.floatcom.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_43274_) floatgetDestroySpeed(ItemStack p_43288_, BlockState p_43289_) booleanhurtEnemy(ItemStack p_43278_, LivingEntity p_43279_, LivingEntity p_43280_) booleanisCorrectToolForDrops(BlockState p_43298_) booleanmineBlock(ItemStack p_43282_, Level p_43283_, BlockState p_43284_, BlockPos p_43285_, LivingEntity p_43286_) Methods inherited from class net.minecraft.world.item.TieredItemgetEnchantmentValue, getTier, isValidRepairItemMethods inherited from class net.minecraft.world.item.ItemappendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDrinkingSound, getEatingSound, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, requiredFeatures, shouldOverrideMultiplayerNbt, toString, use, useOn, useOnRelease, verifyTagAfterLoadMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElementisEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeItemcanApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
- 
Field Details- 
attackDamageprivate final float attackDamage
- 
defaultModifiers
 
- 
- 
Constructor Details- 
SwordItem
 
- 
- 
Method Details- 
getDamagepublic float getDamage()
- 
canAttackBlockpublic boolean canAttackBlock(BlockState p_43291_, Level p_43292_, BlockPos p_43293_, Player p_43294_) - Overrides:
- canAttackBlockin class- Item
 
- 
getDestroySpeed- Overrides:
- getDestroySpeedin class- Item
 
- 
hurtEnemy
- 
mineBlockpublic boolean mineBlock(ItemStack p_43282_, Level p_43283_, BlockState p_43284_, BlockPos p_43285_, LivingEntity p_43286_) 
- 
isCorrectToolForDrops- Overrides:
- isCorrectToolForDropsin class- Item
 
- 
getDefaultAttributeModifierspublic com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_43274_) - Overrides:
- getDefaultAttributeModifiersin class- Item
 
- 
canPerformActionDescription copied from interface:IForgeItemQueries if an item can perform the given action. SeeToolActionsfor a description of each stock action- Specified by:
- canPerformActionin interface- IForgeItem
- Parameters:
- stack- The stack being used
- toolAction- The action being queried
- Returns:
- True if the stack can perform the action
 
 
-