-
Notifications
You must be signed in to change notification settings - Fork 1
VS Code Setup
The Hytale Gradle Plugin can generate a recommended Visual Studio Code configuration for building, running, and debugging a Hytale mod project.
Before generating the VS Code configuration, make sure that:
- Java 25 or newer is installed
- the project can be opened as a Gradle project
- the Hytale Gradle Plugin is applied
- VS Code has permission to write to the project directory
A minimal project configuration looks like:
plugins {
id 'java'
id 'com.azuredoom.hytale-tools' version '1.0.46'
}
hytaleTools {
hytaleVersion = '0.+'
patchline = 'release'
manifestGroup = 'com.example.mods'
modId = 'examplemod'
mainClass = 'com.example.mods.ExampleMod'
}Run:
./gradlew configureVSCodeHytaleRunThe task generates the recommended files under:
.vscode/
Generated files include:
.vscode/
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
These files configure recommended extensions, project settings, Hytale Gradle tasks, and the local server debugger.
You can rerun configureVSCodeHytaleRun when the generated configuration needs to be updated.
The generated file:
.vscode/extensions.json
contains the recommended extensions for the project.
After opening the project in VS Code, install the recommended extensions when prompted. Java and Gradle language support are required for the best experience.
The generated file:
.vscode/settings.json
contains project-level settings used by VS Code's Java and Gradle integrations.
After generation, reload the VS Code window or reopen the project so the settings are applied.
The generated file:
.vscode/tasks.json
contains common Hytale development tasks.
These tasks provide convenient access to operations such as:
- setting up the development environment
- launching the local Hytale server
- preparing decompiled sources
- refreshing generated files
- cleaning generated Hytale outputs and caches
You can run them through:
- Open the Command Palette.
- Select Tasks: Run Task.
- Select the desired Hytale or Gradle task.
You can also continue to run every task directly from the terminal:
./gradlew setupHytaleDev
./gradlew runServer
./gradlew prepareDecompiledSourcesForIdeFor a new checkout or development environment, run:
./gradlew setupHytaleDevThis prepares the normal Hytale development dependencies, sources, and assets.
After it completes:
- Refresh the Gradle project.
- Reload the VS Code window.
- Allow the Java language server to finish indexing.
The Hytale server is distributed as compiled bytecode. The plugin can generate readable sources and install them into local generated repositories for IDE attachment.
Run:
./gradlew prepareDecompiledSourcesForIdeThis prepares sources for:
- the Hytale server
-
vineImplementationdependencies -
vineCompileOnlydependencies -
requiredDependencydependencies -
optionalDependencydependencies - additional
vineDecompileTargets
Generated source repositories are placed under:
build/generated-sources-m2/
build/generated-sources-ivy/
Generated source JARs are placed under:
build/generated-sources-jars/
After generation, refresh the Gradle project in VS Code.
The generated repositories are used for IDE source attachment. They are not replacements for the repositories used by the normal build.
Use vineDecompileTargets when you want IDE sources for a dependency that is not otherwise part of a supported Hytale dependency configuration:
dependencies {
vineDecompileTargets 'com.example:some-api:1.0.0'
}Then regenerate the sources:
./gradlew prepareDecompiledSourcesForIdeBy default, the plugin generates a separate hytale-assets binary library from the resolved Assets.zip.
This keeps Hytale assets separate from the Hytale server library and allows the assets to appear independently in the IDE's external libraries.
The generated asset library:
- is intended for IDE browsing
- is not added to the final mod JAR
- does not modify the generated Hytale server library
- can be disabled when the large asset library is unnecessary
Disable it with:
hytaleTools {
generateAssetsBinary = false
}The plugin will still resolve Assets.zip for local server runs, but it will skip generating the IDE asset binary.
Start the local server from the integrated terminal:
./gradlew runServerYou can also use the generated task from Tasks: Run Task.
For a specific subproject:
./gradlew :modA:runServerFor a workspace containing multiple mods:
./gradlew runAllModsSee Running and Customizing the Development Server for server arguments, JVM options, debugging, and hot swap configuration.
The generated launch configuration is named:
Hytale: runServer
Open the Run and Debug panel in VS Code and select that configuration.
The generated configuration launches the Gradle server task with debugging enabled.
You can also enable debugging manually:
./gradlew runServer -Ddebug=trueThe default debug port is:
5005
Configure another port through hytaleTools:
hytaleTools {
debugEnabled = true
debugPort = 5006
}You can also configure the matching Gradle property:
hytools.debug.port=5006To make the server wait for the debugger before continuing startup:
hytaleTools {
debugEnabled = true
debugSuspend = true
}This is useful when debugging code that executes very early in the server or plugin startup process.
Enable debugging and hot swap with:
./gradlew runServer -Ddebug=true -Dhotswap=trueFor enhanced class redefinition, use JetBrains Runtime:
hytaleTools {
hotSwapEnabled = true
jbrHome = '/path/to/jbr'
}Check the selected runtime with:
./gradlew hytaleJvmDoctorThe diagnostic report shows:
- the Java executable used by
runServer - whether JetBrains Runtime was detected
- whether enhanced class redefinition is supported
- whether HotswapAgent support is available
The plugin can generate a development container for contributors who want a reproducible Java and Gradle environment.
Run:
./gradlew generateHytaleDevContainerThis creates:
.devcontainer/
├── devcontainer.json
└── Dockerfile
The Dev Container is optional. A local Java 25 installation is sufficient for normal development.
After generating the files:
- Install the VS Code Dev Containers extension.
- Open the Command Palette.
- Select Dev Containers: Reopen in Container.
- Allow the container to build.
- Run the normal Gradle setup task inside the container.
./gradlew setupHytaleDevHytale authentication data, local installation paths, and other host-specific resources may need to be mounted or configured separately for the container.
The generated .vscode files provide a starting configuration. You can add project-specific tasks or launch configurations after generation.
When rerunning configureVSCodeHytaleRun, review local customizations to ensure they are not replaced by regenerated content.
For substantial project-specific settings, consider keeping custom tasks or launch configurations clearly separated from generated entries.
Remove project-local generated Hytale outputs with:
./gradlew cleanHytaleGeneratedRemove the cached Hytale assets with:
./gradlew cleanHytaleAssetsCacheClear global decompiled-source and Javadoc caches with:
./gradlew cleanHytaleGlobalCacheThe global cleanup affects all Hytale projects using the same Gradle user home and requires confirmation.
For a non-interactive environment:
./gradlew cleanHytaleGlobalCache \
-PconfirmCleanHytaleGlobalCache=trueAfter cleaning generated sources, run:
./gradlew prepareDecompiledSourcesForIdeThen refresh the Gradle project in VS Code.
Confirm that these files exist:
.vscode/launch.json
.vscode/tasks.json
Regenerate them:
./gradlew configureVSCodeHytaleRunThen reload the window through the Command Palette:
Developer: Reload Window
Run:
./gradlew prepareDecompiledSourcesForIdeThen refresh the Gradle project and restart the Java language server.
If the dependency is not declared through one of the supported dependency configurations, add it to vineDecompileTargets.
Run:
./gradlew cleanHytaleGenerated
./gradlew prepareDecompiledSourcesForIde --rerun-tasksIf the global decompilation cache itself must be recreated, use:
./gradlew cleanHytaleGlobalCacheBe aware that this affects other projects using the same Gradle user home.
Confirm that Javadoc injection is enabled:
hytaleTools {
injectServerJavadocsIntoSources = true
}Make sure the configured patchline is correct and regenerate the sources.
The default hosted documentation URL is selected from the active patchline. It can be overridden with:
hytaleTools {
serverJavadocsUrl =
'https://release.server.docs.hytale.com/'
}Check that:
- the server was launched with debugging enabled
- the configured debug port matches the launch configuration
- another process is not using the port
-
debugSuspendhas not left the server waiting unexpectedly
Run:
./gradlew hytaleJvmDoctorThe selected JVM probably does not support enhanced class redefinition.
Use JetBrains Runtime and confirm it was selected:
./gradlew hytaleJvmDoctorRefresh the Gradle project after changing:
- dependencies
hytaleTools- source sets
- the Java toolchain
- workspace configuration
When needed, reload the VS Code window after the Gradle refresh completes.
- Why use this plugin?
- Quickstart
- Hot Swap Quickstart
- Usage
- Running and Customizing the Development Server
- VS Code Setup
- Configuration
- Extension Reference
- Configurations
- Dependencies
- Manifest dependency fields
- SubPlugins
- AssetBridge