Skip to content

Config Type: Modify

ACGaming edited this page Aug 10, 2024 · 1 revision

Modifying files

With this config type, you can disable, delete, rename or move mods or files.

First of all, your config file needs to end with .modify.json.

Then, the format needs to be the following:

{
	"folder": "mods",
	"fileName": "old_mod.jar"
}

If you want to disable a file, you can add the key disable. The file then gets disabled by adding .disabled-by-mod-director to the file name.

{
	"folder": "mods",
	"fileName": "old_mod.jar",
	"disable": true
}

If you want to delete a file completely for reasons of cleanliness, you can add the key delete:

{
	"folder": "mods",
	"fileName": "old_mod.jar",
	"delete": true
}

When not disabling or deleting files, you can rename by adding the key newFileName or move by adding the key newFolder:

{
	"folder": "mods",
	"fileName": "mod.jar",
	"newFileName": "cooler_mod.jar"
}
{
	"folder": "mods",
	"fileName": "mod.jar",
	"newFolder": "cooler_mods"
}

You can also use both:

{
	"folder": "mods",
	"fileName": "mod.jar",
	"newFileName": "cooler_mod.jar",
	"newFolder": "cooler_mods"
}

In certain cases, you might want to delete folders. You can do so by omitting the key fileName and adding the key delete. Be aware that this irretrievably deletes the folder with all of its contents:

{
	"folder": "old_folder",
	"delete": true
}

This config type can also be used in config bundles:

{
	"modify":
	[
		{
			"folder": "mods",
			"fileName": "disable_mod.jar",
			"disable": true
		},
		{
			"folder": "mods",
			"fileName": "delete_mod.jar",
			"delete": true
		},
		{
			"folder": "mods",
			"fileName": "rename_mod.jar",
			"newFileName": "cooler_mod.jar"
		},
		{
			"folder": "mods",
			"fileName": "move_mod.jar",
			"newFolder": "cooler_mods"
		},
		{
			"folder": "mods",
			"fileName": "rename_move_mod.jar",
			"newFileName": "cooler_mod.jar",
			"newFolder": "cooler_mods"
		},
		{
			"folder": "delete_folder",
			"delete": true
		}
	]
}

This feature is supported in version 1.8.0+

Clone this wiki locally