Skip to content

version warning

Aram edited this page Jul 30, 2025 · 2 revisions

Version Snapshot/Alpha Warning

Overview

BlueLib provides a built-in system to display a version warning screen when your mod is running an unstable, alpha, or snapshot version. This helps inform players that they may encounter bugs or instability in the current build.

This system is customizable and localized through your mod’s language files.


How to Use

To enable the version warning, you need to implement the BuildDetails interface from the software.bluelib package.

Step-by-Step

1. Implement BuildDetails

Create a class that implements:

software.bluelib.BuildDetails

Your implementation should return your mod's version, build status, and other details BlueLib uses to determine if a warning should be shown.

2. Register via Service Loader

Create a service loader file in the following location:

resources/META-INF/services/software.bluelib.BuildDetails

Inside this file, put the fully qualified class name of your BuildDetails implementation. For example:

com.example.mymod.MyModBuildDetails

This tells BlueLib which class provides the build information at runtime.


Language Customization

You can override the default text shown in the version warning by providing the following language keys in your mod’s .lang or .json language file:

yourmodid.version.warning.title=This is a snapshot!
yourmodid.version.warning.description=You are running a development version which may be unstable.
yourmodid.version.warning.dont_show_again=Don't show again
yourmodid.version.warning.dont_show_again_tip=Disables this warning for future launches.
Key Description
yourmodid.version.warning.title The title of the warning screen
yourmodid.version.warning.description Message explaining that the version is unstable
yourmodid.version.warning.dont_show_again Label for the "Don't show again" checkbox
yourmodid.version.warning.dont_show_again_tip Tooltip shown when hovering over the checkbox

If these keys are not provided, BlueLib will fall back to default messages defined in the library’s internal language file.


Key Points

  • Displays a warning screen for snapshot/alpha builds
  • Logic is defined by implementing BuildDetails
  • Uses Java Service Loader system for registration
  • Fully localizable using standard language keys
  • Defaults to BlueLib language if no override is found

For help with implementation, reach out in the official Discord community.

Clone this wiki locally