Build, Run, Deploy
Commands at a glance
| Command | What it does |
|---|---|
build | Compiles, validates poly.mod.json (validatePolyModJson), and creates the mod jar (build/libs/) |
runClient | Runs the client with Poly Mod Loader and this mod (run/client) |
runServer | Runs a dedicated server (run/server). Requires EULA consent |
gameTests "-PpolyTests=crystal_garden:*" | Runs the mod's in-game tests on a game test server (no window) |
worldCreateSaveTest | Loads the mod, creates and saves a world, and checks the log lines listed in build.gradle.kts (no window) |
clientWorldReloadTest | Creates a world in the client and reopens it (a window opens) |
serverBootSmokeTest | Boots a dedicated server up to the EULA check and verifies it |
Build
- Windows (PowerShell)
- macOS · Linux (bash)
.\gradlew.bat build
./gradlew build
The mod jar appears in build/libs/.
Run the game
- Windows (PowerShell)
- macOS · Linux (bash)
.\gradlew.bat runClient
./gradlew runClient
- The client runs in
run/clientand uses an offline account (PolyDev). - If the window title is
Minecraft* <Ver k="minecraft" />(the asterisk marks that mods are applied), the game was started through Poly Mod Loader.
Dedicated server and the EULA
runServer requires you to accept the Minecraft EULA. Poly Mod Loader does not accept it on your behalf. Read it yourself, and if you agree, write eula=true in run/server/eula.txt yourself.
Test
- Windows (PowerShell)
- macOS · Linux (bash)
.\gradlew.bat gameTests "-PpolyTests=crystal_garden:*" # in-game tests
.\gradlew.bat worldCreateSaveTest # world creation, save, and log check
./gradlew gameTests "-PpolyTests=crystal_garden:*" # in-game tests
./gradlew worldCreateSaveTest # world creation, save, and log check
How to use in-game tests is described in Testing.
Deploy
The jar in build/libs/ is your mod. Players install Poly Mod Loader with the installer, then put this jar in the launcher folder's mods/. During development, put it in run/client/mods/ (run/server/mods/ for the server) or run it directly with runClient.
Use the same version on server and client
If a mod uses the same content on the server and the client, both sides need the same version of the jar. The game matches content such as block states by number.
A jar in the mods/ folder is handled like this.
- Poly Mods (
poly.mod.json) are loaded. - Fabric mods are loaded as
Experimentalonly if they use nothing but entrypoints. See Compatibility. - Any other mod is not loaded, and the reason is written to the log.