Interface ToolItemFactory

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ToolItemFactory
A functional interface for creating tool items.

Implementations are responsible for instantiating the actual item class (e.g., SwordItem) using the provided piece, context, and final properties. This factory is typically used by ToolPieceType to create the item.

Since:
3.0.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.Item
    create(ToolPieceType piece, ToolContext context, net.minecraft.world.item.Item.Properties properties)
    Creates a tool item instance.
  • Method Details

    • create

      net.minecraft.world.item.Item create(ToolPieceType piece, ToolContext context, net.minecraft.world.item.Item.Properties properties)
      Creates a tool item instance.
      Parameters:
      piece - the tool piece type (never null)
      context - the tool context providing tier and stats (never null)
      properties - the final item properties (never null)
      Returns:
      the created item, never null