Repository navigation
Custom Information
This page has actual information for RWS v1.4.0+. In older version, many things may be different.
Reimagined World Select supports integration with KubeJS, allowing you to display custom information directly inside the world select screen.
The mod supports nearly unlimited count of variables.
To use stored vars values, insert %var% in the Format.
Each custom line and method in the mod can independently use data from:
- The World. Methods save data for the entire world save folder.
- The Current Player. Methods save data for the current player only by their uuid.
All vars stored in world's folder:
minecraft
↳ saves
↳ (your world folder)
↳ rws_vars
↳ player
↳ <uuid>.json
↳ world
↳ vars.json
To start changing your custom information, first of all import the API at the start of your KubeJS script:
const RWSCustomInfoAPI = Java.loadClass('com.inf2z.reimagined_world_select.api.RWSCustomInfoAPI')
Every custom line has a mode in the config.
- VALUE. Displays the value exactly as it is stored.
- BOOLEAN. Shows True if var value >= 1, and shows False if var value <= 0.
- ON_OFF. Similar to BOOLEAN, but instead of True/False, it's ON/OFF
Sets variable's value to text/number.
Examples:
RWSCustomInfoAPI.varSetValue(1, "world", "hello")
RWSCustomInfoAPI.varSetValue(2, "player", "25")
Adds value to the variable. Works only if variable and the value is a number.
Example:
RWSCustomInfoAPI.varAddValue(2, "player", "5")
Freezes the variable and its value.
Example:
RWSCustomInfoAPI.varFreeze(2, true)
Returns the exact stored value, text or number.
Example:
RWSCustomInfoAPI.varGetValue(2)
Each custom line has the following config options:
- Label -> the text shown before the value. It will add
:at the end of a word - Format -> how the value is inserted
- Mode -> VALUE / BOOLEAN / ON_OFF
- Source -> WORLD / PLAYER
Example:
- Label: Kills
- Format: %var% mobs
- Mode: VALUE
- Source: WORLD
Displayed result:
Kills: 27 mobs
Example KubeJS code:
const RWSCustomInfoAPI = Java.loadClass('com.inf2z.reimagined_world_select.api.RWSCustomInfoAPI')
RWSCustomInfoAPI.varAddValue(1, "world", 1)
Config:
- Custom Line 1 Label: Kills
- Custom Line 1 Format: %var% mobs
- Custom Line 1 Mode: VALUE
- Custom Line 1 Source: WORLD
Example KubeJS code:
const RWSCustomInfoAPI = Java.loadClass('com.inf2z.reimagined_world_select.api.RWSCustomInfoAPI')
RWSCustomInfoAPI.varSetValue(2, "player", "Paladin")
Config:
- Custom Line 2 Label: Class
- Custom Line 2 Format: %var%
- Custom Line 2 Mode: VALUE
- Custom Line 2 Source: PLAYER
Displayed result:
Class: Paladin
Example KubeJS code:
const RWSCustomInfoAPI = Java.loadClass('com.inf2z.reimagined_world_select.api.RWSCustomInfoAPI')
RWSCustomInfoAPI.varSetValue(3, "player", "1")
RWSCustomInfoAPI.varSetValue(4, "player", "0")
Config examples:
Line 3:
- Label: Hardcore Challenge
- Format: %var%
- Mode: BOOLEAN
- Source: PLAYER
Result:
Hardcore Challenge: True
Line 4:
- Label: Quest Active
- Format: %var%
- Mode: ON_OFF
- Source: PLAYER
Result:
Quest Active: OFF
- If variable is frozen, it won't change its value until it is unfrozen.
- If the variable or the added value contains text, varAddValue will return an error. VarAddValue works only with numbers.
- Methods work only when world is loaded.