User Tools

Site Tools


tutorial:tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:tools [2020/07/20 08:54] shedanieltutorial:tools [2020/07/24 07:58] – [Creating the tool objects] minor change to constructor warning boogiemonster1o1
Line 119: Line 119:
 public static ToolItem POTATO_SHOVEL = new ShovelItem(CustomToolMaterial.POTATO, 1.5F, -3.0F, new Item.Settings().group(ItemGroup.TOOLS)); public static ToolItem POTATO_SHOVEL = new ShovelItem(CustomToolMaterial.POTATO, 1.5F, -3.0F, new Item.Settings().group(ItemGroup.TOOLS));
 public static ToolItem POTATO_SWORD = new SwordItem(CustomToolMaterial.POTATO, 3, -2.4F, new Item.Settings().group(ItemGroup.COMBAT)); public static ToolItem POTATO_SWORD = new SwordItem(CustomToolMaterial.POTATO, 3, -2.4F, new Item.Settings().group(ItemGroup.COMBAT));
-public static ToolItem POTATO_HOE = new HoeItem(CustomToolMaterial.POTATO, -2.0F, new Item.Settings().group(ItemGroup.TOOLS)); 
 </code> </code>
-Unfortunately, `PickaxeItem` and `AxeItem` only have protected constructor, so you'll have to make classes that extends each of them. Creating a subclass makes making multiple pickaxes or axes easier.+Unfortunately, `PickaxeItem` , `HoeItem` and `AxeItem` only have protected constructors, so you'll have to make classes that extends each of them. Creating a subclass makes making multiple pickaxes or axes easier.
 <code java [enable_line_numbers=true]> <code java [enable_line_numbers=true]>
 public class PickaxeSubclass extends PickaxeItem { public class PickaxeSubclass extends PickaxeItem {
Line 129: Line 128:
 } }
 </code> </code>
-To make a pickaxe and axe, create objects of the subclasses.+To make a pickaxe, hoe and axe, create objects of the subclasses.
 <code java> <code java>
 public static ToolItem POTATO_PICKAXE = new PickaxeSubclass(CustomToolMaterial.POTATO, 1, -2.8F, new Item.Settings().group(ItemGroup.TOOLS)); public static ToolItem POTATO_PICKAXE = new PickaxeSubclass(CustomToolMaterial.POTATO, 1, -2.8F, new Item.Settings().group(ItemGroup.TOOLS));
 public static ToolItem POTATO_AXE = new AxeSubclass(CustomToolMaterial.POTATO, 7.0F, -3.2F, new Item.Settings().group(ItemGroup.TOOLS)); public static ToolItem POTATO_AXE = new AxeSubclass(CustomToolMaterial.POTATO, 7.0F, -3.2F, new Item.Settings().group(ItemGroup.TOOLS));
 +public static ToolItem POTATO_HOE = new HoeSubclass(CustomToolMaterial.POTATO, 7.0F, -3.2F, new Item.Settings().group(ItemGroup.TOOLS));
 </code> </code>
  
tutorial/tools.txt · Last modified: 2023/09/07 05:32 by drakonkinst