Class SwordItem

All Implemented Interfaces:
FeatureElement, ItemLike, IForgeItem

public class SwordItem extends TieredItem
  • Constructor Details

  • Method Details

    • createToolProperties

      private static Tool createToolProperties()
    • createAttributes

      public static ItemAttributeModifiers createAttributes(Tier p_336181_, int p_335543_, float p_331072_)
    • canAttackBlock

      public boolean canAttackBlock(BlockState p_43291_, Level p_43292_, BlockPos p_43293_, Player p_43294_)
      Overrides:
      canAttackBlock in class Item
    • hurtEnemy

      public boolean hurtEnemy(ItemStack p_43278_, LivingEntity p_43279_, LivingEntity p_43280_)
      Overrides:
      hurtEnemy in class Item
    • canPerformAction

      public boolean canPerformAction(ItemStack stack, ToolAction toolAction)
      Description copied from interface: IForgeItem
      Queries if an item can perform the given action. See ToolActions for a description of each stock action
      Parameters:
      stack - The stack being used
      toolAction - The action being queried
      Returns:
      True if the stack can perform the action