Package net.minecraft.item
Class SwordItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ToolItem
net.minecraft.item.SwordItem
- All Implemented Interfaces:
ItemConvertible,Vanishable
public class SwordItem extends ToolItem implements Vanishable
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description private floatattackDamageprivate Multimap<EntityAttribute,EntityAttributeModifier>field_23745Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM -
Constructor Summary
Constructors Constructor Description SwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Item.Settings settings) -
Method Summary
Modifier and Type Method Description booleancanMine(BlockState state, World world, BlockPos pos, PlayerEntity miner)floatgetAttackDamage()Multimap<EntityAttribute,EntityAttributeModifier>getAttributeModifiers(EquipmentSlot slot)floatgetMiningSpeedMultiplier(ItemStack stack, BlockState state)booleanisEffectiveOn(BlockState state)booleanpostHit(ItemStack stack, LivingEntity target, LivingEntity attacker)booleanpostMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner)Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, damage, finishUsing, fromBlock, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getStackForRender, getTranslationKey, getTranslationKey, getUseAction, hasEnchantmentGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postProcessTag, rayTrace, shouldSyncTagToClient, toString, usageTick, use, useOnBlock, useOnEntity
-
Field Details
-
attackDamage
private final float attackDamage -
field_23745
-
-
Constructor Details
-
SwordItem
public SwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Item.Settings settings)
-
-
Method Details
-
getAttackDamage
public float getAttackDamage() -
canMine
-
getMiningSpeedMultiplier
- Overrides:
getMiningSpeedMultiplierin classItem
-
postHit
-
postMine
public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) -
isEffectiveOn
- Overrides:
isEffectiveOnin classItem
-
getAttributeModifiers
public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)- Overrides:
getAttributeModifiersin classItem
-