Package net.xun.armory.api.item.tools
Interface ToolCustomizer
- All Known Implementing Classes:
AbstractEffectToolCustomizer
public interface ToolCustomizer
Factory interface for creating custom tool items with specialized initialization.
Implementations of this interface provide fine-grained control over tool item
creation, enabling custom tool classes, modified attribute application, or
additional properties beyond standard tool behavior. The
DefaultToolCustomizer.INSTANCE serves as the default implementation
producing standard Minecraft tool items.
Usage Examples:
ToolCustomizer CUSTOM_CLASS = (type, tier, props) -> {
switch (type) {
case SWORD:
return new CustomSwordItem(tier, props);
case AXE:
return new CustomAxeItem(tier, props);
default:
// (throw an exception)
}
};
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemcreateTool(ToolType type, net.minecraft.world.item.Tier tier, net.minecraft.world.item.Item.Properties properties) Creates a tool item instance of the specified type.
-
Method Details
-
createTool
net.minecraft.world.item.Item createTool(ToolType type, net.minecraft.world.item.Tier tier, net.minecraft.world.item.Item.Properties properties) Creates a tool item instance of the specified type.Implementations are responsible for constructing the tool item with the appropriate tier and properties. The returned item should be fully configured and ready for registration and in-game use.
Implementation Notes:- Properties already include any attribute modifications from
AttributeHelper - The tier provides durability, mining level, and base damage
- Custom implementations may return subclasses of standard tools
- Parameters:
type- the type of tool to create (sword, axe, etc.)tier- material tier defining durability, mining level, and base damageproperties- item properties with applied attributes- Returns:
- a fully configured tool item instance, never
null - Throws:
NullPointerException- iftype,tier, orpropertiesisnullIllegalArgumentException- if the tier is incompatible with the tool type or properties are invalid
- Properties already include any attribute modifications from
-