Launch Minecraft servers using Gradle task. For Bukkit, Spigot, Paper, etc..
plugins {
id 'dev.s7a.gradle.minecraft.server' version '3.2.0'
}
plugins {
id("dev.s7a.gradle.minecraft.server") version "3.2.0"
}
Name | Default | Description |
---|---|---|
jarUrl | Required️ | URL to Download the .jar |
jarName | server.jar |
Jar File Name After Download |
serverDirectory | build/MinecraftServer |
Working Directory |
jvmArgument | [] |
Java Options |
serverArgument | [] |
Server Options |
nogui | true |
Without Vanilla GUI |
agreeEula | false |
Agree to the Minecraft EULA |
Warning
This plugin doesn't have a default task. So you have to define it yourself.
task<LaunchMinecraftServerTask>("launchMinecraftServer") {
jarUrl.set(JarUrl.Paper("1.19.2"))
agreeEula.set(true)
}
task<LaunchMinecraftServerTask>("testPlugin") {
dependsOn("build")
doFirst {
copy {
from(buildDir.resolve("libs/${project.name}.jar"))
into(buildDir.resolve("MinecraftServer/plugins"))
}
}
jarUrl.set(JarUrl.Paper("1.19.2"))
agreeEula.set(true)
}
listOf(
"8" to "1.8.8",
"9" to "1.9.4",
"10" to "1.10.2",
"11" to "1.11.2",
"12" to "1.12.2",
"13" to "1.13.2",
"14" to "1.14.4",
"15" to "1.15.2",
"16" to "1.16.5",
"17" to "1.17.1",
"18" to "1.18.2",
"19" to "1.19.4",
"20" to "1.20.4"
).forEach { (name, version) ->
task<LaunchMinecraftServerTask>("testPlugin$name") {
dependsOn("build")
doFirst {
copy {
from(buildDir.resolve("libs/${project.name}.jar"))
into(buildDir.resolve("MinecraftServer$name/plugins"))
}
}
serverDirectory.set(buildDir.resolve("MinecraftServer$name").absolutePath)
jarUrl.set(JarUrl.Paper(version))
agreeEula.set(true)
}
}
- Paper
- Velocity
- Waterfall
- Fabric
- Mohist
- LocalFile