Skip to content

yzl210/HarvestLevelTweaker

Repository files navigation

Harvest Level Tweaker

A minecraft forge mod that allows modpack makers to add new harvest levels with custom names.

Currently supports:

Table of Contents

Add New Harvest Levels

Go to folder config/hltweaker/levels
Create a json file with level id as the name.
For example: cobalt.json will create a new level with id cobalt
Json Format:

{
  "level": <level>,
  "better": ["<tier_id>", ...], 
  "worse": ["<tier_id>", ...], 
  "color": "<color>", 
  "icons": {
    "<mineable tag>": "<item id>",
    ...
  }
}
Field Type Required Description Example
level Integer Yes Order/tier of the custom level. No duplicates with other levels. If lower than 5, better or worse field is required and duplicate is allowed 5
better String Array Required if level is lower than 5 and worse is not set Levels that are better than this level, works only when level is lower than 5 ["minecraft:netherite"]
worse String Array Required if level is lower than 5 and better is not set Levels that are worse than this level, works only when level is lower than 5 ["minecraft:diamond"]
color String No (Default: white) Color of the harvest level in hex format (prefix #) or color name "#0047ab" or "blue"
icons Json Object No Icons for the harvest level in "<mineable_tag>": "<item id>" format {"minecraft:mineable/pickaxe": "minecraft:stone_pickaxe"}

Example: cobalt.json:

{
  "level": 5,
  "color": "#0047ab", 
  "icons": {
    "minecraft:mineable/pickaxe": "kubejs:cobalt_pickaxe",
    "minecraft:mineable/axe": "kubejs:cobalt_axe",
    "minecraft:mineable/shovel": "kubejs:cobalt_shovel",
    "minecraft:mineable/hoe": "kubejs:cobalt_hoe"
  }
}

This will create a new level with id cobalt and level 5.
Or it can be as simple as:

{
  "level": 5
}

Example: copper.json:

{
  "level": 1,
  "better": ["minecraft:iron"],
  "worse": ["minecraft:stone"]
}

This will create a new level with id copper between tier stone and iron (better than stone, worse than iron)

Override Item Harvest Level and Harvest Type

Find the file config/hltweaker/item_harvest_level_overrides.json

Json Format:

{
  "<item id>": {
    "<mineable tag>": "<level id>"
  }
}
  • <item id>: Item id. Example: minecraft:stone
  • <mineable tag>: The mineable tag (required tool type). Example: minecraft:mineable/pickaxe
  • <level id>: Harvest level id (with namespace if it's not from this mod). Example: cobalt or minecraft:wood

Example item_harvest_level_overrides.json:

{
  "minecraft:golden_pickaxe": {
    "minecraft:mineable/pickaxe": "cobalt",
    "minecraft:mineable/axe": "minecraft:netherite"
  },
  "minecraft:netherite_pickaxe": {
    "minecraft:mineable/pickaxe": "minecraft:wood"
  }
}

This will remove all existing harvest types and level of stone pickaxe and netherite pickaxe.
Then set the harvest level of stone pickaxe to cobalt as a pickaxe and netherite when used as an axe.
And set the harvest level of netherite pickaxe to wood when used as a pickaxe.

Set Block Harvest Level

Create a datapack and add the blocks to tag:

  • Harvest Level Tweaker Levels: hltweaker:needs_<level id>_tool
  • Vanilla levels:
    • stone, iron, diamond: minecraft:needs_<level id>_tool
    • wood, gold, netherite: forge:needs_<level id>_tool

Example data/hltweaker/tags/blocks/needs_cobalt_tool.json:

{
  "values": [
    "#minecraft:stone",
    "kubejs:cobalt_block"
  ]
}

This will set all blocks under minecraft:stone tag and cobalt block to require cobalt level tools.

Localization and custom vanilla level names

  • Translation key for custom harvest level is text.hltweaker.level.<level id>
    Example: "text.hltweaker.level.cobalt": "Cobalt"
  • Translation key for tool type is text.hltweaker.tool.<mod namespace>.<tool type>
    Example: "text.hltweaker.tool.minecraft.pickaxe": "Pickaxe", "text.hltweaker.tool.paxelmod.paxel": "Paxel"
  • Translation key for vanilla harvest level is text.hltweaker.level.minecraft.<wood/gold/stone/iron/diamond/netherite>
    Example: "text.hltweaker.level.minecraft.wood": "This is Wood Level"

Client Config

Client config is located at config/hltweaker/client.toml
You can change the color of vanilla harvest levels in the config.
More details can be found in the config file.

Commands

/hltweaker levels - Show vanilla and Harvest Level Tweaker levels
/hltweaker levels all - Show all harvest levels that are registered in the game
/hltweaker overrides - Show item harvest level overrides

Set Tinker's Construct Material Level (1.18 Only)

In your datapack for tinker's construct, set the harvest level of the material to hltweaker:<level id>

About

Harvest Level Tweaker for Minecraft

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages