User Tools

Site Tools


tutorial:blocks

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:blocks [2020/06/14 00:57] – fix header sizes draylartutorial:blocks [2020/06/14 00:58] – copy comments to bottom code block draylar
Line 174: Line 174:
 public class ExampleMod implements ModInitializer { public class ExampleMod implements ModInitializer {
  
-    // an instance of our new block +    /* Declare and initialize our custom block instance using our new ExampleBlock class. 
-    public static final ExampleBlock EXAMPLE_BLOCK = new ExampleBlock(Block.Settings.of(Material.STONE));+       We set out block material to METAL, which requires a pickaxe to efficiently break. 
 +       Hardness represents how long the break takes to break. Stone has a hardness of 1.5f, while Obsidian has a hardness of 50.0f. 
 +    */ 
 +    public static final ExampleBlock EXAMPLE_BLOCK = new ExampleBlock(Block.Settings.of(Material.STONE).hardness(4.0f));
          
     @Override     @Override
tutorial/blocks.txt · Last modified: 2024/04/15 01:52 by solidblock