Wiki 9Minecraft World Handler Wiki

World Handler — Guide

Controls and Navigation

The primary method of interacting with the mod is through its dedicated GUI. By default, the interface is accessed using a specific keybind, which can be reconfigured in the standard Minecraft controls menu.

Action Default Key
Open World Handler GUI V
Close GUI ESC

Upon opening the GUI, users are presented with a grid of icons representing different management categories. Hovering over an icon provides a tooltip description of its function.

World Management

The World Management section provides instant access to environmental variables. This eliminates the need for commands like /time set or /weather.

Time Control

Users can set the world time to specific presets: * Sunrise: Sets time to 0. * Noon: Sets time to 6000. * Sunset: Sets time to 12000. * Midnight: Sets time to 18000. * Time Freeze: Toggles the doDaylightCycle gamerule.

Weather Control

Weather can be toggled instantly between three states: * Clear: Removes rain and thunder. * Rain: Initiates standard precipitation. * Thunder: Initiates a thunderstorm. * Weather Lock: Toggles the doWeatherCycle gamerule.

Difficulty and Rules

This sub-menu allows for the rapid adjustment of the world's difficulty (Peaceful, Easy, Normal, Hard) and the toggling of common Gamerules such as keepInventory, mobGriefing, and fireTick.

Player and Inventory Management

The Player Management interface allows for the modification of player states and inventory contents. This is particularly useful for creative building or server testing.

Gamemode Switching

Quick buttons are provided for all standard gamemodes: * Survival * Creative * Adventure * Spectator

Player Stats

Users can manipulate their current status effects and vitals: * Heal: Restores full health and hunger. * Clear Effects: Removes all active potion effects. * Experience: Adds specific levels of XP to the player. * Fly: Toggles flight capabilities regardless of gamemode (requires server-side support).

Inventory Tools

  • Clear Inventory: Wipes the player's inventory (with a confirmation prompt).
  • Give Item: Opens a searchable list of all items in the game, allowing users to add them to their inventory with custom stack sizes.

The item selection screen within World Handler

Usercontent API Reference

World Handler API version 2.0 allows users to extend the mod's functionality by creating custom JSON files. These files must be placed in the .minecraft/config/worldhandler/usercontent/ directory.

Guidelines

  • All custom content must follow valid JSON syntax.
  • Images used for custom buttons should be in .png format and placed in the textures sub-folder.
  • Custom scripts are written in JavaScript and stored in the scripts sub-folder.

Widget States

Widgets (buttons and menu elements) can have different visual properties based on their state:

State Description
NORMAL The default appearance of the widget.
HOVER The appearance when the mouse cursor is over the widget.
PRESSED The appearance when the widget is being clicked.
DISABLED The appearance when the widget is inactive or unavailable.

Button Configuration

Custom buttons are defined by their action and dimensions.

Action Types: * COMMAND: Executes a standard Minecraft command. * SCRIPT: Runs a JavaScript file from the scripts folder. * MENU: Opens a different sub-menu. * CLOSE: Closes the GUI.

Dimensions: Buttons require x, y, width, and height parameters relative to the menu container.

JavaScript API

For advanced automation, the mod exposes several internal objects to the JavaScript engine. This allows for logic-based command execution.

Available Objects

  • player: Provides access to the player's name, position, and inventory.
  • world: Provides access to world time, weather, and block data.
  • server: Allows for the execution of console-level commands.

Common Functions

Function Description
executeCommand(string) Runs a command as the player.
printChat(string) Displays a message in the player's local chat.
getPlayerX, getY, getZ Returns the player's current coordinates.
isRaining Returns a boolean indicating current weather.

Example Script:

// Toggles creative mode and notifies the player
if (player.getGamemode == "survival") {
 executeCommand("/gamemode creative");
 printChat("Creative Mode Enabled");
} else {
 executeCommand("/gamemode survival");
 printChat("Survival Mode Enabled");
}