Minecraft Data Packs / Game Mechanic

Craftsmen | Master villagers can repair your gear

    • 6,498 views, 25 today
    • 634 downloads, 3 today
    • 39
    • 41
    • 13
    Required Resource Pack
    Lordphenex's Avatar Lordphenex
    Level 41 : Master Miner
    19
    Presentation
    Have you ever felt like mending enchantment is a bit overpowered ? But you can't repair your favorite bow with an anvil because it's too expensive ?
    This datapacks aims to solve that problem by adding the ability to Master villagers to repair your stuff !


    How does it work ?

    - First you need to make a master villager become a craftsman. The villager will get a new special trade that will allow you to repair your stuff :
    In order to do so, you have to hold an emerald_block in your offhand and the corresponding work station block in your mainhand. Then right-click on the master villager while sneaking. This will play a little noise and show particles at the villager. In 1.17 and above, the work station will be consumed as a more experimented villager needs more space to work. (version 1.16-1.19)
    For version 1.20.4+, you need to craft mastery tomes using an emerald block, a book and a working station. Then give them to master villager for them to unlock the repair trade.

    - Once the trade has been added to the villager, in order to repair an item, just hold it in your mainhand while buying the "Repair Token" from the villager.
    Of course each villager is specialized to different types of item (list of matches is shown below).
    This trade restores a certain amount of durability to your item, based on the villager experience, item enchantments and a bit of randomness.
    Don't worry if your item is not matching the villager profession or it is already fully repaired as you will get a refund in those cases.
    Please note that in MC version 1.16.5 and below, you can't shift-click on the trade and you have to do one repair at a time.
    However, in 1.17.1 and above you can do it the way you want.

    - If you don't want the villager to be a craftsman anymore, repeat the same process as for adding the repair trade but instead of holding a work station, you need to be holding a paper (only for versions 1.16-1.19).


    Here is a list of what each profession can repair as items
    Armorer : all pieces of armor, excepted leather ones

    Fletcher : bows and crossbows

    Leatherworker : leather armors

    Toolsmith : all tools (axes, hoes, pickaxes and shovels)

    Weaponsmith : all swords and axes



    Configuration (1.20.4+ only)
    You can configurate this datapack by using /function #lordphenex:help.
    2 parameters can be configured :
    The maximum durability craftsmen can repair at once (default to 850, 1.20.4).
    The maximum durability percentage craftsmen can repair at once (default to 75, 1.20.6+).

    The removal of mending book trades from librarians (default to 1). 0 won't remove said trades, 1 will remove then except for swamp master (because of trade rebalance), 2 will remove them for all librarians.



    Uninstallation
    This datapack provides a way of removing all of its content, just use either one of following commands :
    /function lordphenex:_uninstall.craftsmen
    /function #lordphenex:help


    Reporting bugs or possible improvements
    If you experience any issue with this datapack, please reach me out by commenting this post, I'll answer as soon as I can.
    Please keep in mind that a constructive comment is always better a single phrase comment, especially when something doesn't work as it should do.
    Some functions in this datapack fail to load because of syntax error, this is perfectly fine and work as intended. Failing functions depend on MC version : if you're playing on 1.17 and above, there should be only one function that fail and in 1.16 an below, there should be 3. This is perfectly fine and does not break the datapack at all. I made it that way so there is only one download for MC version from 1.16 to 1.19. These function files are located in the folders called 1_16 and 1_17.


    Licensing
    This work is licensed under the CC BY-NC-ND 4.0 meaning that you cannot share a modified version of my datapacks. You also are not allowed to sell any part nor the entirety of my datapacks. In any case, if you share one of my datapacks (through a video or on a server, for example), you must give me credit.
    CreditMisode for their generator
    CompatibilityMinecraft 1.16
    toMinecraft 1.20
    Tags

    4 Update Logs

    Update #4 : by Lordphenex 07/22/2024 3:51:49 pmtoday

    Fixed wrong folder naming, causing load function not to run
    LOAD MORE LOGS

    Create an account or sign in to comment.

    adscomics
    07/21/2024 12:56 am
    Level 3 : Apprentice Miner
    adscomics's Avatar
    I've been trying to use this data pack in 1.21, but it does not seem to be working on my end, unless I'm doing something wrong. I crafted the tome, and right clicked on the villager, and he then has the repair token trade. However, when I trade for it, I just get the token and nothing happens. Based on the description, shouldn't the tool in my main hand be repaired? I did this with a toolsmith on a pickaxe, and also tested on a different world with a shovel. The other world didn't have any other data packs installed (I guess except for the default Fabric one), so I'm not sure what's up, unless there's another step I'm not doing.
    2
    Lordphenex
    07/21/2024 9:11 am
    Level 41 : Master Miner
    Lordphenex's Avatar
    Hey, that's weird, it looks like the advancement trigger for the trade doesn't trigger.

    Can you try these command
    /advancement revoke @s only lordphenex:craftsmen/trade_repair_token (this one should tell you don't have this advancement)
    /tag @s add lordphenex.debug
    and then try again trading with the villager, you should have a lot of stuff going on in the chat. If it is not the case then try to load the datapack in fully vanilla minecraft, I don't know if there could be compatibility issues with Fabric
    1
    adscomics
    07/21/2024 12:41 pm
    Level 3 : Apprentice Miner
    history
    adscomics's Avatar
    Ran those command for revoking the advancement, and it indeed showed me as not having it. Below is what returned when I tried trading after running the /tag command:

    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/main
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/craftsman_data\nToolsmith
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] trade\n{buy:{count:44,id:"minecraft:emerald"},demand:-495,maxUses:99,rewardExp:0b,sell:{components:{"minecraft:custom_data":{lordphenex:{craftsmen:1b,data:{repair_token:1b}}},"minecraft:custom_model_data":7680673,"minecraft:item_name":'{"fallback":"Repair Token","translate":"lordphenex.craftsmen.item.repair_token"}',"minecraft:lore":['{"color":"gray","fallback":"Repair held item","italic":false,"translate":"lordphenex.craftsmen.item.repair_token.lore"}'],"minecraft:rarity":"uncommon"},count:1,id:"minecraft:paper"},uses:1,xp:40}\ncraftsman.Xp\n875\nprofession\nminecraft:toolsmith
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : damage
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : passed damage test
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : armorer passed
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : fletcher passed
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : leatherworker passed
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : toolsmith passed
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/not_matching : tests passed
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair : Xp
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair : computation1
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair : repairPercentage
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair : randomRepair
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/repair : repairPercentage total
    [​11:24:32] [​Render thread/INFO]: [​System] [​CHAT] repair/main clearing

    I also tried performing the trade but with Fabric disabled, but with no change. In fact, in subsequent tests, I can't actually get the trade to show up at all, as the tome just gets consumed with nothing else happening.
    2
    Lordphenex
    07/22/2024 3:54 pm
    Level 41 : Master Miner
    Lordphenex's Avatar
    Ok I think I found what wasn't working. It has been fixed in the latest version of the pack.
    You can download it and tell me if anything is still broken but that should hopefully not be the case anymore.

    Sorry for the inconvenience
    1
    adscomics
    07/22/2024 6:41 pm
    Level 3 : Apprentice Miner
    adscomics's Avatar
    Not a problem, thank you for such a speedy response!

    Just tested it and it works like a charm. Thanks for making this! I always felt that Mending was a really cheap fix for the broken repair system, and I think this is a fantastic alternative!
    2
    Lordphenex
    07/23/2024 11:49 am
    Level 41 : Master Miner
    Lordphenex's Avatar
    Thanks a lot for taking time reporting the issue.
    I wish you a lot of fun while playing with (or without) this datapack
    1
    AlterNate_1337
    03/27/2024 11:23 pm
    Level 1 : New Collective
    AlterNate_1337's Avatar
    Oh yeah - one more thing, not a bug cause it's fully intentional but what limits a master craftsman from repairing gear? Does it have anything to do with enchants, cause I've got an unbreaking/eff. 3 Diamond axe with 4 points of durability, tryna figure out whether it's functionally identical to the anvil or if there's more at play here, both toolsmith and weaponsmith can't tinker with it
    2
    Lordphenex
    07/20/2024 2:42 pm
    Level 41 : Master Miner
    Lordphenex's Avatar
    Hey !

    Problem has been solved in latest releases (1.20.6 and 1.21)
    It was due to a logic problem caused by myself.

    Sorry for the inconvenience
    1
    Lordphenex
    04/11/2024 2:59 pm
    Level 41 : Master Miner
    Lordphenex's Avatar
    Hello sorry for the late response, I was pretty busy these times.
    Enchantments make it harder for craftsmen to repair gear. I don't have the maths in mind but they should be able to repair a little bit of the axe anyway. The repair amount also scale up with the craftsman overall xp.

    Anyway, I will be updating this pack when 1.20.5 comes up and will fully test it at that time.
    2
    MadMars
    03/15/2024 2:39 am
    Level 10 : Journeyman Explorer
    MadMars's Avatar
    This is genuinely such a good idea. It keeps villagers relevant without just making them OP traders and finally gives an alternative to the mending balance nightmare. Thanks!
    2

    Welcome