User Tools

Site Tools


tutorial:mining_levels

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
tutorial:mining_levels [2022/03/26 01:29] – updated the mining levels main page to 1.18 cascadecollapsetutorial:mining_levels [2022/09/29 05:07] (current) solidblock
Line 2: Line 2:
  
 ==== Introduction ==== ==== Introduction ====
-The way mining levels and preferred tools are assigned has changed significantly in 1.18. Making your tools and blocks interact properly only requires adding them to specific tags.+The way mining levels and preferred tools are assigned has changed significantly in 1.17. Making your tools and blocks interact properly now requires adding them to specific tags.
  
 ==== Setting the preferred tool for your block ==== ==== Setting the preferred tool for your block ====
  
-To define what tool is used to harvest your block, you need to add the block's identifier to a tag inside of tags/blocks/mineable that corresponds to your tool ("''pickaxe.json''","''axe.json''", etc.): +To define what tool is used to harvest your block, you need to add the block's identifier to a tag inside of ''tags/blocks/mineable'' that corresponds to your tool ("''pickaxe.json''","''axe.json''", etc.): 
-<code JavaScript tags/blocks/mineable/pickaxe.json>+<code JavaScript /src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json>
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:example_ore_block", +    "tutorial:example_ore_block", 
-    "examplemod:example_cobblestone_block"+    "tutorial:example_cobblestone_block"
   ]   ]
 } }
 </code> </code>
  
-Fabric API also provides two additional tags ''fabric:mineable/sword'' and ''fabric:mineable/shears'' for blocks that can be harvested with a sword or shears. You put these tags in ''resources/fabric/tags/blocks/mineable''.+Fabric API also provides two additional tags ''fabric:mineable/sword'' and ''fabric:mineable/shears'' for blocks that can be harvested with a sword or shears. You put these tags in ''resources/data/fabric/tags/blocks/mineable/''.
  
 ==== Setting the block's mining level ==== ==== Setting the block's mining level ====
Line 29: Line 29:
  
 Here we make our late-game ore variants require a diamond tool to harvest: Here we make our late-game ore variants require a diamond tool to harvest:
-<code JavaScript minecraft/tags/blocks/needs_diamond_tool.json>+<code JavaScript /src/main/resources/data/minecraft/tags/blocks/needs_diamond_tool.json>
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:example_late_game_ore", +    "tutorial:example_late_game_ore", 
-    "examplemod:example_late_game_deepslate_ore"+    "tutorial:example_late_game_deepslate_ore"
   ]   ]
 } }
Line 40: Line 40:
  
 Fabric API provides dynamic tags for mining levels above diamond, as well as for wood (mining level 0). Dynamic mining level tags are in the format ''fabric:needs_tool_level_N'', where ''N'' is the wanted tool level as an integer. For example, a mining level tag for netherite (mining level 4) would be ''fabric:needs_tool_level_4''. Dynamic tags are checked automatically. You put these tags in ''resources/fabric/tags/blocks/''. Fabric API provides dynamic tags for mining levels above diamond, as well as for wood (mining level 0). Dynamic mining level tags are in the format ''fabric:needs_tool_level_N'', where ''N'' is the wanted tool level as an integer. For example, a mining level tag for netherite (mining level 4) would be ''fabric:needs_tool_level_4''. Dynamic tags are checked automatically. You put these tags in ''resources/fabric/tags/blocks/''.
-<code JavaScript resources/fabric/tags/blocks/needs_tool_level_4.json>+<code JavaScript /src/main/resources/data/fabric/tags/blocks/needs_tool_level_4.json>
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:example_tough_block", +    "tutorial:example_tough_block", 
-    "examplemod:example_netherite_anvil_block"+    "tutorial:example_netherite_anvil_block"
   ]   ]
 } }
Line 57: Line 57:
 Example of adding a pickaxe to the ''pickaxes'' tag: Example of adding a pickaxe to the ''pickaxes'' tag:
  
-File Location: /src/main/resources/data/fabric/tags/items/pickaxes.json +<code javascript /src/main/resources/data/fabric/tags/items/pickaxes.json>
-<code javascript>+
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:example_pickaxe"+    "tutorial:example_pickaxe"
   ]   ]
 } }
 </code> </code>
tutorial/mining_levels.1648258151.txt.gz · Last modified: 2022/03/26 01:29 by cascadecollapse