Omni Ocular
Attention: Check the changelog before using this modification with Java19.
The modification is actively being developed.
Overview
Omni Ocular is an advanced tool for displaying custom NBT data through the Waila HUD interface. Useful for experienced users who value precise metrics, as well as for testing and debugging mods.
This project develops the concept of WailaNBT, offering completely rewritten code and significantly expanded functionality.
Installation
Required Components
Requires Not Enough Items and Waila mods on both client and server sides. Simply place the JAR files in the mods folder.
For convenient work with NBT data, installing In-Game NBTEdit is recommended to study NBT data structure and optimize display settings.
Gallery
Start working immediately after installation - no additional actions required.
Configuration Setup
Omni Ocular uses XML files for profile configuration. They can be found in the minecraft/config/OmniOcular folder after the first launch.
In-Game Commands
-
/oor(Omni Ocular Reload) - reloads all XML configurations from the specified folder. If the command is used on a server, new settings are automatically distributed to all online players. -
/ooe(Omni Ocular Entity) - shows the type of entity the cursor is pointing at. -
/oon(Omni Ocular Name) - displays the full name of the item being held.
Creating a Configuration File
Configuration files use XML format with embedded JavaScript code and must comply with the standards of these technologies.
It's recommended to name files after the ID of the mod for which the configuration is intended. Example configuration:
<!--Author: EpixZhang-->
<!--Date: 2015/1/1-->
<!--Version: 1.0-->
<oo>
<init>
function tick2second(n){return n/20}
</init>
<tileentity id="Furnace">
<line displayname="Burn Time">
return tick2second(nbt['BurnTime'])
</line>
</tileentity>
<entity id="Sheep">
<line displayname="Until next love">
tick2second(nbt['InLove'])
</line>
</entity>
<tooltip id="minecraft:skull">
<line displayname="Owner">
return nbt['SkullOwner']
</line>
</tooltip>
</oo>
Information Block:
<!--Author: EpixZhang-->
<!--Date: 2015/1/1-->
<!--Version: 1.0-->
This section is optional but useful for tracking version and author information.
Main Structure:
All working elements must be inside the <oo></oo> tags.
Tile Entity Blocks:
Defining information displayed for blocks with additional data:
<tileentity id="Furnace"></tileentity>
The "id" attribute defines the specific block type. Regular expressions are supported for group selection.
Entity Elements:
Setting up data display for living creatures:
<entity id="Sheep"></entity>
Item Tooltips:
Adding information to tooltips when hovering the cursor:
<tooltip id="minecraft:skull"></tooltip>
Initialization Block:
Here frequently used functions and variables are placed:
<init></init>
Code executes when configuration is loaded.
Display Lines:
Format for defining individual data lines:
<line displayname="Name">
JavaScript code
</line>
JavaScript code should return a value for display. The default format is: name (white) + tabulation + value (gray). To change the color of the entire line, leave displayname empty.
Special Formatting Characters
Constants are available for convenient use of formatting codes:
BLACK, DBLUE, DGREEN, DAQUA, DRED, DPURPLE, GOLD, GRAY, DGRAY, BLUE, GREEN, AQUA, RED, LPURPLE, YELLOW, WHITE, OBF, BOLD, STRIKE, UNDER, ITALIC, RESET
TAB - tabulation character ALIGNRIGHT, ALIGNCENTER - text alignment HEART, HHEART, EHEART - heart symbols
Built-in JavaScript Functions
translate() - returns localized text name() - shows object name fluidName() - localized fluid name holding() - ID of held item armor() - ID of equipped armor isInHotbar() - check for item in hotbar isInInv() - check for item in entire inventory
Practical Application
Imagine you want to track furnace status in real time:
<oo>
<tileentity id="Furnace">
<line displayname="Cooking progress">
return nbt['CookTime']
</line>
</tileentity>
</oo>
To identify object types, use /ooe (for entities) and /oon (for items) commands.
Working with Configurations
Client Side
All XML files from the minecraft/config/OmniOcular folder are loaded. Based on installed mods, preliminary settings are automatically created that don't overwrite existing files.
Server Side
Configuration files work similarly to the client version, but preliminary settings are not created automatically. In multiplayer gaming, server settings take priority over client settings.
Development Plans
- Support for displaying data for items on the ground
- Ability to hide information via conditional commands (for example, keypress)