From mschae’s docs
→Server: Start documenting filters |
→Server: Document filters |
||
| Line 108: | Line 108: | ||
*** {{Json|boolean|requires_enchantment}}: whether the item that should have its repair cost reset is required to have an enchantment (default: <code>true</code>). | *** {{Json|boolean|requires_enchantment}}: whether the item that should have its repair cost reset is required to have an enchantment (default: <code>true</code>). | ||
*** {{Json|object|cost_function}}: see [[#Cost function|cost function]]. | *** {{Json|object|cost_function}}: see [[#Cost function|cost function]]. | ||
** {{Json|object|filter}}: filters for all enchantment movements. | ** {{Json|object|filter}}: filters for all enchantment movements. Vanilla functionality (simple disenchanting without keeping enchanted books) should not be affected. | ||
*** {{Json|boolean|enabled}}: whether filters are in effect (default: <code>true</code>). | *** {{Json|boolean|enabled}}: whether filters are in effect (default: <code>true</code>). | ||
*** {{Json|object|item}}: which items can be used in disenchanting, or repair cost resets. | *** {{Json|object|item}}: which items can be used in disenchanting, or repair cost resets. | ||
**** {{Json|array|enchantments}} (misnamed; should | **** {{Json|array|enchantments}} (misnamed; should have been <span class="json-key">"items"</span>): list of item IDs, to be used as either an allowlist or denylist. If set to an empty array, all item types can be used (default: <code>[]</code>). | ||
**** {{Json|string|action}}: if set to <code>"allow"</code>, ''only'' the mentioned items can be used. If set to <code>"deny"</code>, all items but the mentioned ones can be used (default: <code>"deny"</code>). | **** {{Json|string|action}}: if set to <code>"allow"</code>, ''only'' the mentioned items can be used. If set to <code>"deny"</code>, all items but the mentioned ones can be used (default: <code>"deny"</code>). | ||
** {{Json|int|version}}: config version ( | *** {{Json|object|enchantment}}: which enchantments can be extracted from items. | ||
**** {{Json|array|enchantments}}: list of enchantment IDs, to be used as either an allowlist or denylist. If set to an empty array, all enchantment types can be used, as long as no other filter applies (default: <code>[]</code>). | |||
**** {{Json|string|action}}: if set to <code>"allow"</code>, only the specified enchantments can be extracted (other enchantments will remain on the item). If set to <code>"ignore"</code>, only enchantments that ''aren't'' listed can be extracted (the specified enchantments will remain on the item). If set to <code>"deny"</code>, items that have any of the listed enchantments cannot be used at all (default: <code>"ignore"</code>). | |||
*** {{Json|string|cursed_enchantments}}: if set to <code>"allow"</code>, curses are not treated specially. If set to <code>"ignore"</code>, curses will remain on the item when disenchanting. If set to <code>"deny"</code>, cursed items cannot be used at all (default: <code>"ignore"</code>). | |||
** {{Json|int|version}}: config version (latest: <code>4</code>). | |||
=== Cost function === | === Cost function === | ||
TODO. | TODO. | ||
</div> | </div> | ||
Revision as of 14:28, 14 October 2025
The configuration files of Grind enchantments can be found in the .minecraft/config/grindenchantments directory. If you don't know how to find this, see the .minecraft page on the Minecraft wiki. If the files don't exist, the mod will create them automatically.
There should be two files here: server.json and client.json.
Defaults
The default values in the server config:
{
"disenchant_to_book": {
"enabled": true,
"consume_enchanted_item": false,
"cost_function": {
"function": {
"function": {
"type": "grindenchantments:count_min_power"
},
"factor": 0.3,
"offset": 8.0,
"type": "grindenchantments:transform"
},
"type": "grindenchantments:filter"
}
},
"move_enchantments": {
"enabled": true,
"cost_function": {
"function": {
"function": {
"function": {
"normal_factor": 3.0,
"treasure_factor": 8.0,
"type": "grindenchantments:count_levels"
},
"factor": 0.5,
"offset": 0.5,
"type": "grindenchantments:transform"
},
"type": "grindenchantments:first_enchantment"
},
"type": "grindenchantments:filter"
}
},
"reset_repair_cost": {
"enabled": false,
"catalyst_items": "minecraft:diamond",
"requires_enchantment": true,
"cost_function": {
"function": {
"function": {
"normal_factor": 1.0,
"treasure_factor": 4.0,
"type": "grindenchantments:count_levels"
},
"type": "grindenchantments:average_count"
},
"factor": 1.5,
"offset": 4.0,
"type": "grindenchantments:transform"
}
},
"filter": {
"enabled": true,
"item": {
"enchantments": [],
"action": "deny"
},
"enchantment": {
"enchantments": [],
"action": "ignore"
},
"cursed_enchantments": "ignore"
},
"dedicated_server_options": {
"alternative_cost_display_enabled": false
},
"version": 4
}
The default values in the client config:
{
"show_enchantment_cost": true,
"sync_options": {
"use_local_server_config_if_unsynced": true,
"log_received_config": false
},
"version": 4
}
Server
The server.json file contains the majority of the mod's configuration options, being used on the logical server. Most importantly, it is possible to disable certain features and change the disenchantment costs.
- object: server config.
- "disenchant_to_book" (object): configuration for the “disenchant to book” feature.
- "enabled" (boolean): whether to enable the feature (default:
true). - "consume_enchanted_item" (boolean): if enabled, the original item will be consumed when disenchanting; only the enchantments themselves can be obtained (default:
false). - "cost_function" (object): see cost function.
- "enabled" (boolean): whether to enable the feature (default:
- "move_enchantments" (object): configuration for the “move enchantments between books” feature.
- "enabled" (boolean): whether to enable the feature (default:
true). - "cost_function" (object): see cost function.
- "enabled" (boolean): whether to enable the feature (default:
- "reset_repair_cost" (object): configuration for the “reset repair cost” feature.
- "enabled" (boolean): whether to enable the feature (default:
false). - "catalyst_items" (array): an array of item IDs (or a single item ID) which have to be inserted alongside the item that should have its repair cost reset (default:
"minecraft:diamond"). - "requires_enchantment" (boolean): whether the item that should have its repair cost reset is required to have an enchantment (default:
true). - "cost_function" (object): see cost function.
- "enabled" (boolean): whether to enable the feature (default:
- "filter" (object): filters for all enchantment movements. Vanilla functionality (simple disenchanting without keeping enchanted books) should not be affected.
- "enabled" (boolean): whether filters are in effect (default:
true). - "item" (object): which items can be used in disenchanting, or repair cost resets.
- "enchantments" (array) (misnamed; should have been "items"): list of item IDs, to be used as either an allowlist or denylist. If set to an empty array, all item types can be used (default:
[]). - "action" (string): if set to
"allow", only the mentioned items can be used. If set to"deny", all items but the mentioned ones can be used (default:"deny").
- "enchantments" (array) (misnamed; should have been "items"): list of item IDs, to be used as either an allowlist or denylist. If set to an empty array, all item types can be used (default:
- "enchantment" (object): which enchantments can be extracted from items.
- "enchantments" (array): list of enchantment IDs, to be used as either an allowlist or denylist. If set to an empty array, all enchantment types can be used, as long as no other filter applies (default:
[]). - "action" (string): if set to
"allow", only the specified enchantments can be extracted (other enchantments will remain on the item). If set to"ignore", only enchantments that aren't listed can be extracted (the specified enchantments will remain on the item). If set to"deny", items that have any of the listed enchantments cannot be used at all (default:"ignore").
- "enchantments" (array): list of enchantment IDs, to be used as either an allowlist or denylist. If set to an empty array, all enchantment types can be used, as long as no other filter applies (default:
- "cursed_enchantments" (string): if set to
"allow", curses are not treated specially. If set to"ignore", curses will remain on the item when disenchanting. If set to"deny", cursed items cannot be used at all (default:"ignore").
- "enabled" (boolean): whether filters are in effect (default:
- "version" (int): config version (latest:
4).
- "disenchant_to_book" (object): configuration for the “disenchant to book” feature.
Cost function
TODO.