Package net.minecraft.world.item
Class SwordItem
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<Item>
net.minecraft.world.item.Item
net.minecraft.world.item.TieredItem
net.minecraft.world.item.SwordItem
- All Implemented Interfaces:
Vanishable
,ItemLike
,IForgeItem
,IForgeRegistryEntry<Item>
- Direct Known Subclasses:
PlayerAttackKnockbackTest.KnockbackSwordItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate float
private com.google.common.collect.Multimap<Attribute,AttributeModifier>
Fields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, category, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
ConstructorDescriptionSwordItem(Tier p_43269_, int p_43270_, float p_43271_, Item.Properties p_43272_)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAttackBlock(BlockState p_43291_, Level p_43292_, BlockPos p_43293_, Player p_43294_)
boolean
canPerformAction(ItemStack stack, ToolAction toolAction)
Queries if an item can perform the given action.float
com.google.common.collect.Multimap<Attribute,AttributeModifier>
getDefaultAttributeModifiers(EquipmentSlot p_43274_)
float
getDestroySpeed(ItemStack p_43288_, BlockState p_43289_)
boolean
hurtEnemy(ItemStack p_43278_, LivingEntity p_43279_, LivingEntity p_43280_)
boolean
isCorrectToolForDrops(BlockState p_43298_)
boolean
mineBlock(ItemStack p_43282_, Level p_43283_, BlockState p_43284_, BlockPos p_43285_, LivingEntity p_43286_)
Methods inherited from class net.minecraft.world.item.TieredItem
getEnchantmentValue, getTier, isValidRepairItem
Methods inherited from class net.minecraft.world.item.Item
allowdedIn, appendHoverText, asItem, byBlock, byId, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, fillItemCategory, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDrinkingSound, getEatingSound, getEquipSound, getFoodProperties, getId, getItemCategory, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTags, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, shouldOverrideMultiplayerNbt, toString, use, 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, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
-
Field Details
-
attackDamage
private final float attackDamage -
defaultModifiers
-
-
Constructor Details
-
SwordItem
-
-
Method Details
-
getDamage
public float getDamage() -
canAttackBlock
public boolean canAttackBlock(BlockState p_43291_, Level p_43292_, BlockPos p_43293_, Player p_43294_)- Overrides:
canAttackBlock
in classItem
-
getDestroySpeed
- Overrides:
getDestroySpeed
in classItem
-
hurtEnemy
-
mineBlock
public boolean mineBlock(ItemStack p_43282_, Level p_43283_, BlockState p_43284_, BlockPos p_43285_, LivingEntity p_43286_) -
isCorrectToolForDrops
- Overrides:
isCorrectToolForDrops
in classItem
-
getDefaultAttributeModifiers
public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_43274_)- Overrides:
getDefaultAttributeModifiers
in classItem
-
canPerformAction
Description copied from interface:IForgeItem
Queries if an item can perform the given action. SeeToolActions
for a description of each stock action- Specified by:
canPerformAction
in interfaceIForgeItem
- Parameters:
stack
- The stack being usedtoolAction
- The action being queried- Returns:
- True if the stack can perform the action
-