Skip to content

Custom Folder

Modifying the name

The first and the most simple one is simply changing the folder name. You can do this by using the serverFolderName method. This will use a folder inside the main project path with that name.

There are two serverFolderName methods: one provides a consumer with FolderData, and one just takes in the folder name:

Groovy
runServer {
    minecraftVersion("1.21.4")
    serverFolderName("folderName")
}
Groovy
runServer {
    minecraftVersion("1.21.4")
    serverFolderName { "folderName" }
}

Modifying the entire path

You can also modify the entire file path it's going to use. You can do this by using the serverFolder method.

Groovy
runServer {
    minecraftVersion("1.21.4")
    serverFolder(File("serverFolder"))
}
Groovy
runServer {
    minecraftVersion("1.21.4")
    serverFolder { File(buildFolder, "${serverType.name.lowercase()}-{${minecraftVersion}}") }
}

Released under the MIT License.