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 [2021/10/09 01:27] – [Registering your Block] solidblocktutorial:blocks [2021/11/02 13:04] – add requiresTool() to FabricBlockSettings to make harvest level tags work suicuiune
Line 156: Line 156:
   ]   ]
 } }
 +</code>
 +
 +For the harvest level tags (needs_stone_tool, needs_iron_tool and needs_diamond_tool) to take effect, add requiresTool() to the FabricToolSettings in the block declaration:
 +
 +
 +<code java [enable_line_numbers="true"]>
 +    public static final Block EXAMPLE_BLOCK = new ExampleBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f).requiresTool());
 </code> </code>
  
tutorial/blocks.txt · Last modified: 2024/04/15 01:52 by solidblock