I'm trying to make a tools that slowly get better the more you use them in the right way. So pickaxe on stone, axe on wood, sword on zombies. But I cant figure out a way to make that system. I was guessing making a variable in tool material for example HarvestLevel that goes class and that class does all the heavy lifting.
I'm not entirely experienced with modding but I'm not completely new.
If you apply this to vanilla tools, you will most likely use NBT tags and events, specifically the ItemUseEvent to keep track of levels. I'm not entirely certain how to make the tool get better based on that level, though.
Applying this to your own tools should be a bit easier because you can modify the efficiency of the tool based on the level.
Do NOT do anything like making a variable in the ToolMaterial because that requires directly editing base classes, which causes huge incompatibility.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Look at what I've done as mentioned earlier. I've pretty much built an entire system similar to what you are talking about, but you can check out how I handled the experience and such with the source code.