Placeholders
Automatically updating script Java placeholder (3.14.x and up)
As of ServerPackCreator version 3.14.x you can define properties which, when configured correctly, will set the SPC_JAVA_SPC
-placeholder in the script variables depending on which Java version is required by Minecraft. This makes testing your server pack on your system much easier, as you no longer need to edit the variables.txt
after you generated your server pack.
The property in question:
de.griefed.serverpackcreator.script.javaN
Where N
represents the version of the Java installation you want to make available to ServerPackCreator for script placeholder editing. Set any of these to the exact path to your correlating Java executable or binary file.
Examples:
de.griefed.serverpackcreator.script.java8=C\:/Program Files/Java/jdk1.8.0_331/bin/java.exe
de.griefed.serverpackcreator.script.java17=C\:/Program Files/Java/jdk-17.0.3.1/bin/java.exe
Now, when you select your Minecraft version in your GUI, or load an already existing configuration, ServerPackCreator will set the value for the SPC_JAVA_SPC
-placeholder to either C\:/Program Files/Java/jdk1.8.0_331/bin/java.exe
or C\:/Program Files/Java/jdk-17.0.3.1/bin/java.exe
, depending on whether the Minecraft version requires Java 8 or Java 17.
The SPC_JAVA_SPC
-placeholder in the scripts in the ZIP-archives, should you choose to let ServerPackCreator create one, will still be set to java
. This is to ensure that anyone who downloads or uses your server pack will use their own Java version, or has the required Java version installed by the start-scripts. It is discouraged to create a ZIP-file yourself, as a manually created ZIP-file may contain files disallowed on CurseForge/Modrinth/etc..
Deactivating the automatic updating of the Java placeholder
It may not be desired by everyone to always automatically update the Java placeholder in the script variables. If you don't want ServerPackCreator to do so, set the following property in your serverpackcreator.properties
to false
de.griefed.serverpackcreator.script.java.autoupdate
This will disable the automatic updating of the SPC_JAVA_SPC
-placeholder in your script variables.