Watch Attribute

Understand Watch attribute

Overview

Applying the [JahroWatch] attribute to your fields or properties will make them accessible in Jahro's Watcher Mode, allowing you to track changes in real time.

Let's have a look at how it's done:

[JahroWatch("Health")]
private int playerHealth = 100;

In this case, the 'playerHealth' field is under Jahro's supervision, with its current value displayed as 'PlayerHealth' in the Watcher Mode.

⚠️

Note: Jahro don't modify values in Watcher Mode. Please use Commands functionality to change actual values.

The [JahroWatch] attribute offers multiple options for customization, including naming, description, and grouping:

Naming

When using the JahroWatch attribute, it's necessary to specify a name. This name is what's displayed in the Watcher Mode. Here's an example:

[JahroWatch("Health")]
private int playerHealth = 100;

Description

This description will be visible in the UI, providing further clarity on the variable's function.

[JahroWatch("Health", "The player's current health")]
private int playerHealth = 100;

Grouping

To keep your watched variables neatly organized, Jahro allows you to specify a group name. Variables with identical group names will be grouped together in the Watcher Mode UI. If no group name is provided, the variable will be assigned to the 'Default' group.

[JahroWatch("Health", "The player's current health", "Player Stats")]
private int playerHealth = 100;