mschae23 / grind-enchantments

Put enchantments back on a book using a grindstone.
https://legacy.curseforge.com/minecraft/mc-mods/grind-enchantments
GNU Lesser General Public License v3.0
12 stars 13 forks source link

Edited config Json doesn't work #47

Closed MrMattsBlog closed 4 months ago

MrMattsBlog commented 1 year ago

Long story short: i edited the config, here's the final:

{ "allow_removing_curses": false, "dedicated_server_options": { "alternative_cost_display_enabled": false }, "client_options": { "show_enchantment_cost": true }, "disenchant_to_book": { "enabled": true, "consume_enchanted_item": false, "cost_function": { "function": { "type": "grindenchantments:count_levels" }, "factor": 0.05, "offset": 1.0, "type": "grindenchantments:transform" } }, "move_enchantments": { "enabled": true, "cost_function": { "function": { "function": { "normal_factor": 0.5, "treasure_factor": 0.5, "type": "grindenchantments:count_levels" }, "type": "grindenchantments:first_enchantment" }, "factor": 0.5, "offset": 0.5, "type": "grindenchantments:transform" } }, "version": 2 }

Apparently something went wrong and the game didn't apply the edits, also I read this message in the logs: Error decoding config: No key treasure_factor in MapLike[{"type":"grindenchantments:count_levels"}]; No key normal_factor in MapLike[{"type":"grindenchantments:count_levels"}]

How do I edit correctly the config? Is there a bug or something?

mschae23 commented 1 year ago

The error message already kind of tells you that, but you need the normal_factor and treasure_factor fields in the object where you have type set to grindenchantments:count_levels:

{
  "allow_removing_curses": false,
  "dedicated_server_options": {
    "alternative_cost_display_enabled": false
  },
  "client_options": {
    "show_enchantment_cost": true
  },
  "disenchant_to_book": {
    "enabled": true,
    "consume_enchanted_item": false,
    "cost_function": {
      "function": {
        "normal_factor": 1.0,
        "treasure_factor": 1.0,
        "type": "grindenchantments:count_levels"
      },
      "factor": 0.05,
      "offset": 1.0,
      "type": "grindenchantments:transform"
    }
  },
  "move_enchantments": {
    "enabled": true,
    "cost_function": {
      "function": {
        "function": {
          "normal_factor": 0.5,
          "treasure_factor": 0.5,
          "type": "grindenchantments:count_levels"
        },
        "type": "grindenchantments:first_enchantment"
      },
      "factor": 0.5,
      "offset": 0.5,
      "type": "grindenchantments:transform"
    }
  },
  "version": 2
}

I know there's absolutely no documentation on what any of these options do right now (sorry), so here's a summary:

In the example above, I set both to 1.0, meaning you'd need exactly one XP level per enchantment level (if you ignore the subsequent factor and offset); however, you can set that to whatever you want, of course.

MrMattsBlog commented 1 year ago

I see.. anyway I got the config automatically when I launched the mod. I even tried to delete it and re-download it, but it was still missing those two factors, so maybe you should check that out. Meanwhile, I literally copy/pasted the config you provided me in the previous reply into my config, now the game asks me 2xp level per enchanted tool, it doesn't matter how many enchantments there are on it and how powerful they're.

To make myself more clear: I have a bow with Mending, Unbreaking III and Efficiency IV. Paying 1xp level per enchantment (considering the enchantments levels), I should pay 8xp level to move all the bow's enchants to a book, right? But the game asks me only 2xp level. Same thing goes for another bow with only Efficiency IV (again, it should cost 4xp level but it costs 2). Is there anything wrong with my config?

Anyway thanks for replying so fast, I really appreciate it!

MrMattsBlog commented 1 year ago

Ok apparently it seems I fixed it, I changed the config file and now it's all good, so you can close the issue. One last thing I'd like to say is to create some sort of documentation (even something written for dummies like me :P ), that will probably help the "average player" better understand the mod and probably will reduce the number of open issues ahah! As previously, thanks for the help, you can close this thread if you want!!

Thanks again for all the effort you're putting into this mod, I really appreciate it!