promotional bannermobile promotional banner

ServerVariables | Custom Data and Variables for Players

[Server-Side] This mod allows you to create your own variables for the server and players, meaning you have total control on which values you set

File Details

ServerVariables.jar

  • R
  • Jan 15, 2026
  • 5.08 MB
  • 109
  • Early Access

File Name

ServerVariables.jar

Supported Versions

  • Early Access

Changelog

All notable changes to ServerVariables will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.0] - 2026-01-15

Added

  • YAML Variable Configuration System: Variables can now be defined in YAML files within plugins/DonKolia_ServerVariables/variables/

    • Support for multiple YAML files to organize variables by category
    • Automatic loading and validation of variable definitions
    • Hot-reload capability with /svar reload command
  • Variable Type System: Three data types supported

    • INTEGER - Whole numbers with min/max validation
    • DOUBLE - Decimal numbers with min/max validation
    • TEXT - String values with character limit validation
  • Configurable Limitations:

    • max_value and min_value for numeric variables
    • max_characters for text variables
    • manage_out_of_range option to auto-adjust or reject out-of-range values
  • Automatic Initial Values:

    • Numeric variables default to min_value
    • Text variables default to empty string
  • Complete Command Set:

    • /svar set <variable> <value> <player> [silent:true] - Set variable value
    • /svar get <variable> <player> - Get variable value
    • /svar add <variable> <value> <player> [silent:true] - Add to numeric variable
    • /svar reduce <variable> <value> <player> [silent:true] - Subtract from numeric variable
    • /svar reset <variable> <player> [silent:true] - Reset to initial value
    • /svar reload - Reload configuration and variables
  • Silent Mode: All modification commands support silent:true parameter to suppress confirmation messages

  • MySQL Persistent Storage:

    • Automatic table creation on first run
    • Stores player UUID, name, variable key, and value
    • Composite primary key on (uuid, var_key)
  • Public API for Developers:

    • ServerVariablesAPI.setVariable() - Set variable programmatically
    • ServerVariablesAPI.getVariable() - Get variable with optional default value
    • Full validation and limitation enforcement through API
  • Example Configuration Files:

    • variables_numerales.yml - Example numeric variables (gold, level, experience, skill points, reputation)
    • variables_tipo_texto.yml - Example text variables (rank, title, clan, prefix, suffix)
  • Validation System:

    • Type checking for all variable assignments
    • Range validation for numeric values
    • Character limit enforcement for text values
    • Descriptive error messages for validation failures
  • VariablesManager: Centralized variable definition management

    • Loads all YAML files from variables directory
    • Validates variable configurations on load
    • Provides variable metadata to commands and API
    • Console logging for successful variable loading

Fixed

  • Variable Recognition in Commands: Fixed issue where variables defined in YAML were not being recognized by /svar set command
  • VariablesManager Initialization: Ensured proper initialization and variable loading on plugin startup
  • Console Feedback: Added detailed console output for variable loading to aid debugging

Changed

  • API Enhancement: setVariable() now requires player name parameter to keep player_name column updated
  • Configuration Structure: Moved from single config file to organized YAML-based system

Technical Details

  • Java Version: Requires Java 21
  • Build System: Gradle with Shadow plugin
  • Database: MySQL/MariaDB compatible
  • Hytale Compatibility: Built for Hytale modding API

Future Roadmap

Planned Features

  • Variable groups and categories
  • Permission-based variable access control
  • Variable change events for other plugins
  • Bulk operations for multiple variables
  • Import/export functionality
  • Web dashboard for variable management

Author: DonKolia
License: Created for Hytale