tutorial:tools
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:tools [2022/12/16 00:32] – [Creating Tools] no item groups now solidblock | tutorial:tools [2023/09/07 05:32] (current) – [Creating Tools] drakonkinst | ||
---|---|---|---|
Line 88: | Line 88: | ||
</ | </ | ||
- | '' | + | '' |
==== Creating Tools ==== | ==== Creating Tools ==== | ||
- | All base tool classes (''< | + | **In newer versions, all base tool class constructors are public and can be used directly to register the item.** This constructor lets you specify attack damage and attack speed of the tool. |
- | < | + | < |
- | public static class_1831 | + | public static class_1831 |
- | public static class_1831 | + | public static class_1831 POTATO_AXE = new AxeItem(PotatoToolMaterial.INSTANCE, |
+ | public static class_1831 | ||
</ | </ | ||
+ | |||
+ | === Creating Tool Subclasses === | ||
+ | |||
+ | **This section is not necessary in the current version of Fabric.** This is a good way to implement special attributes or behaviors for your tool, however. | ||
+ | |||
+ | In older versions, all base tool classes (''< | ||
''< | ''< | ||
Line 114: | Line 121: | ||
public static class_1831 POTATO_HOE = new CustomHoeItem(PotatoToolMaterial.INSTANCE, | public static class_1831 POTATO_HOE = new CustomHoeItem(PotatoToolMaterial.INSTANCE, | ||
</ | </ | ||
- | |||
- | If you want to add any special attributes or behaviors to your tool, create a subclass that extends one of the base tool classes, and override any required methods. | ||
==== Registering Tools ==== | ==== Registering Tools ==== |
tutorial/tools.1671150771.txt.gz · Last modified: 2022/12/16 00:32 by solidblock