Package net.minecraft.item
Class SwordItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.SwordItem
public class SwordItem extends Item
- Mappings:
Namespace Name official aayintermediary net/minecraft/class_27named net/minecraft/item/SwordItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.ToolMaterialType -
Field Summary
Fields Modifier and Type Field Description private floatattackMultiplierprivate Item.ToolMaterialTypematerialFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_UUID, damageable, handheld, maxCount, RANDOM, REGISTRY -
Constructor Summary
Constructors Constructor Description SwordItem(Item.ToolMaterialType material) -
Method Summary
Modifier and Type Method Description booleancanRepair(ItemStack stack, ItemStack ingredient)Returns whether the item can be repaired via an anvil or crafting table.floatgetAttackDamage()Multimap<String,AttributeModifier>getAttributeModifierMap()Returns a map containing entity attributes that are modified by the itemintgetEnchantability()Returns the enchantability of an Item.intgetMaxUseTime(ItemStack stack)floatgetMiningSpeedMultiplier(ItemStack stack, Block block)StringgetToolMaterial()UseActiongetUseAction(ItemStack stack)Returns the UseAction for an item when the item is used.booleanisEffectiveOn(Block block)booleanisHandheld()Returns whether the item is supposed to look as handheld.booleanonBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity)booleanonEntityHit(ItemStack stack, LivingEntity entity1, LivingEntity entity2)ItemStackonStartUse(ItemStack stack, World world, PlayerEntity player)Methods inherited from class net.minecraft.item.Item
appendItemStacks, appendTooltip, byRawId, canUseOnEntity, fromBlock, getDisplayColor, getDisplayName, getFromId, getItemGroup, getItemstackTranslatedName, getMaxCount, getMaxDamage, getMeta, getRarity, getRawId, getRecipeRemainder, getStatusEffectString, getTranslationKey, getTranslationKey, hasEnchantmentGlint, hasStatusEffectString, hasSubTypes, inventoryTick, isDamageable, isEnchantable, isFood, isNetworkSynced, isUnbreakable, onCraft, onFinishUse, onHit, onUseStopped, postProcessTag, registerBlockItem, setHandheld, setItemGroup, setMaxCount, setMaxDamage, setRecipeRemainder, setStatusEffectString, setTranslationKey, setUnbreakable, setup, shouldRotate, shouldSyncTagToClient, use
-
Field Details
-
attackMultiplier
private float attackMultiplier- Mappings:
Namespace Name Mixin selector official aLaay;a:Fintermediary field_58Lnet/minecraft/class_27;field_58:Fnamed attackMultiplierLnet/minecraft/item/SwordItem;attackMultiplier:F
-
material
- Mappings:
Namespace Name Mixin selector official bLaay;b:Lzw$a;intermediary field_59Lnet/minecraft/class_27;field_59:Lnet/minecraft/class_2054$class_2055;named materialLnet/minecraft/item/SwordItem;material:Lnet/minecraft/item/Item$ToolMaterialType;
-
-
Constructor Details
-
SwordItem
- Mappings:
Namespace Name Mixin selector official <init>Laay;<init>(Lzw$a;)Vintermediary <init>Lnet/minecraft/class_27;<init>(Lnet/minecraft/class_2054$class_2055;)Vnamed <init>Lnet/minecraft/item/SwordItem;<init>(Lnet/minecraft/item/Item$ToolMaterialType;)V
-
-
Method Details
-
getAttackDamage
public float getAttackDamage()- Mappings:
Namespace Name Mixin selector official gLaay;g()Fintermediary method_24Lnet/minecraft/class_27;method_24()Fnamed getAttackDamageLnet/minecraft/item/SwordItem;getAttackDamage()F
-
getMiningSpeedMultiplier
- Overrides:
getMiningSpeedMultiplierin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lafh;)Fintermediary method_8262Lnet/minecraft/class_2054;method_8262(Lnet/minecraft/class_2056;Lnet/minecraft/class_160;)Fnamed getMiningSpeedMultiplierLnet/minecraft/item/Item;getMiningSpeedMultiplier(Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/Block;)F
-
onEntityHit
- Overrides:
onEntityHitin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lpr;Lpr;)Zintermediary method_8263Lnet/minecraft/class_2054;method_8263(Lnet/minecraft/class_2056;Lnet/minecraft/class_1752;Lnet/minecraft/class_1752;)Znamed onEntityHitLnet/minecraft/item/Item;onEntityHit(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z
-
onBlockBroken
public boolean onBlockBroken(ItemStack stack, World world, Block block, BlockPos pos, LivingEntity entity)- Overrides:
onBlockBrokenin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lafh;Lcj;Lpr;)Zintermediary method_8258Lnet/minecraft/class_2054;method_8258(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_160;Lnet/minecraft/class_1372;Lnet/minecraft/class_1752;)Znamed onBlockBrokenLnet/minecraft/item/Item;onBlockBroken(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/LivingEntity;)Z
-
isHandheld
Returns whether the item is supposed to look as handheld.- Overrides:
isHandheldin classItem- Mappings:
Namespace Name Mixin selector official w_Lzw;w_()Zintermediary method_8305Lnet/minecraft/class_2054;method_8305()Znamed isHandheldLnet/minecraft/item/Item;isHandheld()Z
-
getUseAction
Returns the UseAction for an item when the item is used. Used by food, potions, bows, etc.- Overrides:
getUseActionin classItem- Parameters:
stack- The ItemStack that was used- See Also:
BowItem,PotionItem- Mappings:
Namespace Name Mixin selector official eLzw;e(Lzx;)Laba;intermediary method_8285Lnet/minecraft/class_2054;method_8285(Lnet/minecraft/class_2056;)Lnet/minecraft/class_30;named getUseActionLnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
-
getMaxUseTime
- Overrides:
getMaxUseTimein classItem- Mappings:
Namespace Name Mixin selector official dLzw;d(Lzx;)Iintermediary method_8281Lnet/minecraft/class_2054;method_8281(Lnet/minecraft/class_2056;)Inamed getMaxUseTimeLnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
-
onStartUse
- Overrides:
onStartUsein classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lwn;)Lzx;intermediary method_8260Lnet/minecraft/class_2054;method_8260(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;named onStartUseLnet/minecraft/item/Item;onStartUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
isEffectiveOn
- Overrides:
isEffectiveOnin classItem- Mappings:
Namespace Name Mixin selector official bLzw;b(Lafh;)Zintermediary method_8271Lnet/minecraft/class_2054;method_8271(Lnet/minecraft/class_160;)Znamed isEffectiveOnLnet/minecraft/item/Item;isEffectiveOn(Lnet/minecraft/block/Block;)Z
-
getEnchantability
public int getEnchantability()Returns the enchantability of an Item. Used by tools and armor- Overrides:
getEnchantabilityin classItem- Returns:
- Enchantability
- See Also:
ToolItem,ArmorItem- Mappings:
Namespace Name Mixin selector official bLzw;b()Iintermediary method_8269Lnet/minecraft/class_2054;method_8269()Inamed getEnchantabilityLnet/minecraft/item/Item;getEnchantability()I
-
getToolMaterial
- Mappings:
Namespace Name Mixin selector official hLaay;h()Ljava/lang/String;intermediary method_25Lnet/minecraft/class_27;method_25()Ljava/lang/String;named getToolMaterialLnet/minecraft/item/SwordItem;getToolMaterial()Ljava/lang/String;
-
canRepair
Returns whether the item can be repaired via an anvil or crafting table.- Overrides:
canRepairin classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Lzx;)Zintermediary method_8267Lnet/minecraft/class_2054;method_8267(Lnet/minecraft/class_2056;Lnet/minecraft/class_2056;)Znamed canRepairLnet/minecraft/item/Item;canRepair(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
-
getAttributeModifierMap
Returns a map containing entity attributes that are modified by the item- Overrides:
getAttributeModifierMapin classItem- Mappings:
Namespace Name Mixin selector official iLzw;i()Lcom/google/common/collect/Multimap;intermediary method_8291Lnet/minecraft/class_2054;method_8291()Lcom/google/common/collect/Multimap;named getAttributeModifierMapLnet/minecraft/item/Item;getAttributeModifierMap()Lcom/google/common/collect/Multimap;
-