Class SwordItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.SwordItem

public class SwordItem
extends Item
Mappings:
Namespace Name
official aay
intermediary net/minecraft/class_27
named net/minecraft/item/SwordItem
  • Field Details

    • attackMultiplier

      private float attackMultiplier
      Mappings:
      Namespace Name Mixin selector
      official a Laay;a:F
      intermediary field_58 Lnet/minecraft/class_27;field_58:F
      named attackMultiplier Lnet/minecraft/item/SwordItem;attackMultiplier:F
    • material

      private final Item.ToolMaterialType material
      Mappings:
      Namespace Name Mixin selector
      official b Laay;b:Lzw$a;
      intermediary field_59 Lnet/minecraft/class_27;field_59:Lnet/minecraft/class_2054$class_2055;
      named material Lnet/minecraft/item/SwordItem;material:Lnet/minecraft/item/Item$ToolMaterialType;
  • Constructor Details

    • SwordItem

      public SwordItem​(Item.ToolMaterialType material)
      Mappings:
      Namespace Name Mixin selector
      official <init> Laay;<init>(Lzw$a;)V
      intermediary <init> Lnet/minecraft/class_27;<init>(Lnet/minecraft/class_2054$class_2055;)V
      named <init> Lnet/minecraft/item/SwordItem;<init>(Lnet/minecraft/item/Item$ToolMaterialType;)V
  • Method Details

    • getAttackDamage

      public float getAttackDamage()
      Mappings:
      Namespace Name Mixin selector
      official g Laay;g()F
      intermediary method_24 Lnet/minecraft/class_27;method_24()F
      named getAttackDamage Lnet/minecraft/item/SwordItem;getAttackDamage()F
    • getMiningSpeedMultiplier

      public float getMiningSpeedMultiplier​(ItemStack stack, Block block)
      Overrides:
      getMiningSpeedMultiplier in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Lafh;)F
      intermediary method_8262 Lnet/minecraft/class_2054;method_8262(Lnet/minecraft/class_2056;Lnet/minecraft/class_160;)F
      named getMiningSpeedMultiplier Lnet/minecraft/item/Item;getMiningSpeedMultiplier(Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/Block;)F
    • onEntityHit

      public boolean onEntityHit​(ItemStack stack, LivingEntity entity1, LivingEntity entity2)
      Overrides:
      onEntityHit in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Lpr;Lpr;)Z
      intermediary method_8263 Lnet/minecraft/class_2054;method_8263(Lnet/minecraft/class_2056;Lnet/minecraft/class_1752;Lnet/minecraft/class_1752;)Z
      named onEntityHit Lnet/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:
      onBlockBroken in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Ladm;Lafh;Lcj;Lpr;)Z
      intermediary method_8258 Lnet/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;)Z
      named onBlockBroken Lnet/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

      @Environment(CLIENT) public boolean isHandheld()
      Returns whether the item is supposed to look as handheld.
      Overrides:
      isHandheld in class Item
      Mappings:
      Namespace Name Mixin selector
      official w_ Lzw;w_()Z
      intermediary method_8305 Lnet/minecraft/class_2054;method_8305()Z
      named isHandheld Lnet/minecraft/item/Item;isHandheld()Z
    • getUseAction

      public UseAction getUseAction​(ItemStack stack)
      Returns the UseAction for an item when the item is used. Used by food, potions, bows, etc.
      Overrides:
      getUseAction in class Item
      Parameters:
      stack - The ItemStack that was used
      See Also:
      BowItem, PotionItem
      Mappings:
      Namespace Name Mixin selector
      official e Lzw;e(Lzx;)Laba;
      intermediary method_8285 Lnet/minecraft/class_2054;method_8285(Lnet/minecraft/class_2056;)Lnet/minecraft/class_30;
      named getUseAction Lnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
    • getMaxUseTime

      public int getMaxUseTime​(ItemStack stack)
      Overrides:
      getMaxUseTime in class Item
      Mappings:
      Namespace Name Mixin selector
      official d Lzw;d(Lzx;)I
      intermediary method_8281 Lnet/minecraft/class_2054;method_8281(Lnet/minecraft/class_2056;)I
      named getMaxUseTime Lnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
    • onStartUse

      public ItemStack onStartUse​(ItemStack stack, World world, PlayerEntity player)
      Overrides:
      onStartUse in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Ladm;Lwn;)Lzx;
      intermediary method_8260 Lnet/minecraft/class_2054;method_8260(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;
      named onStartUse Lnet/minecraft/item/Item;onStartUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
    • isEffectiveOn

      public boolean isEffectiveOn​(Block block)
      Overrides:
      isEffectiveOn in class Item
      Mappings:
      Namespace Name Mixin selector
      official b Lzw;b(Lafh;)Z
      intermediary method_8271 Lnet/minecraft/class_2054;method_8271(Lnet/minecraft/class_160;)Z
      named isEffectiveOn Lnet/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:
      getEnchantability in class Item
      Returns:
      Enchantability
      See Also:
      ToolItem, ArmorItem
      Mappings:
      Namespace Name Mixin selector
      official b Lzw;b()I
      intermediary method_8269 Lnet/minecraft/class_2054;method_8269()I
      named getEnchantability Lnet/minecraft/item/Item;getEnchantability()I
    • getToolMaterial

      public String getToolMaterial()
      Mappings:
      Namespace Name Mixin selector
      official h Laay;h()Ljava/lang/String;
      intermediary method_25 Lnet/minecraft/class_27;method_25()Ljava/lang/String;
      named getToolMaterial Lnet/minecraft/item/SwordItem;getToolMaterial()Ljava/lang/String;
    • canRepair

      public boolean canRepair​(ItemStack stack, ItemStack ingredient)
      Returns whether the item can be repaired via an anvil or crafting table.
      Overrides:
      canRepair in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Lzx;)Z
      intermediary method_8267 Lnet/minecraft/class_2054;method_8267(Lnet/minecraft/class_2056;Lnet/minecraft/class_2056;)Z
      named canRepair Lnet/minecraft/item/Item;canRepair(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
    • getAttributeModifierMap

      public Multimap<String,​AttributeModifier> getAttributeModifierMap()
      Returns a map containing entity attributes that are modified by the item
      Overrides:
      getAttributeModifierMap in class Item
      Mappings:
      Namespace Name Mixin selector
      official i Lzw;i()Lcom/google/common/collect/Multimap;
      intermediary method_8291 Lnet/minecraft/class_2054;method_8291()Lcom/google/common/collect/Multimap;
      named getAttributeModifierMap Lnet/minecraft/item/Item;getAttributeModifierMap()Lcom/google/common/collect/Multimap;