Wide area tools are tools that can be used on more than one block at a time.
This is essentially what Magna used to do, but it sadly no longer seems to be supported.
Registering the Item
TrUtils has built-in support for pickaxes, axes, shovels, and hoes.
public static final Item WIDE_PICKAXE = REGISTRY.addItem(ExampleItemIds.WIDE_PICKAXE, settings -> new WideAreaToolItem(settings.pickaxe(ToolMaterial.NETHERITE, 5, 5), 1, 1));
public static final Item WIDE_AXE = REGISTRY.addItem(ExampleItemIds.WIDE_AXE, settings -> new WideAreaAxeItem(ToolMaterial.NETHERITE, 5, 5, settings, 1, 1));
public static final Item WIDE_SHOVEL = REGISTRY.addItem(ExampleItemIds.WIDE_SHOVEL, settings -> new WideAreaShovelItem(ToolMaterial.NETHERITE, 5, 5, settings, 1, 1));
public static final Item WIDE_HOE = REGISTRY.addItem(ExampleItemIds.WIDE_HOE, settings -> new WideAreaHoeItem(ToolMaterial.NETHERITE, 5, 5, settings, 1, 1));2
3
4
The first two 5s in each line are attack damage and attack speed respectively.
The first 1 is the break radius of the tool (outside of the default 1x1 of normal tools). 1 means the tool will break in a 3x3 area.
The second 1 is the break depth of the tool.
Don't forget to add a texture, translation, client item, item model, and add your item to the appropriate item tag.
Custom Tools
Let's say you've spend a long time on your Custom Tool™, and you want to make a wide area version of it.
All you have to do is implement WideAreaTool on your class.