Logic: Flow & Data
Flow nodes route execution; data nodes are pure values — no exec pins, they compute whenever something reads them.
Variables — three scopes, real persistence
| Scope | Lifetime | Storage |
|---|---|---|
session | While this menu session is open (survives in-place screen switches) | Memory — cart contents, selections, wizard steps |
player | Permanent per player — survives relogs and restarts | Saved inside the player's own data (no files to manage) |
global | Permanent server-wide | plugins/NxGui/vars.yml, auto-saved |
Branch branch
The if/else. Routes execution down True or False based on the condition input — usually fed by Compare, Has Permission or Get Element Value.
Compare compare
A vs B with = ≠ < ≤ > ≥. Pure data node — no exec pins; wire Result into a Branch. When both sides parse as numbers it compares numerically, otherwise as text — so placeholder strings like "12" just work.
And / Or / Not boolOp
Boolean algebra for combining conditions before a Branch. Choosing not hides the second input — exactly like the editor does.
Has Permission hasPermission
Checks the viewing player's permission node → bool. The gate for VIP-only buttons, staff panels, or price discounts (Branch → two different Run Command chains).
Cooldown cooldown
A keyed, per-player rate limiter. First pass through goes out Ready and arms the timer; until it expires, execution exits Waiting instead. Remaining s outputs the seconds left — feed it into the deny message so players see a live countdown.
- Different Key = independent cooldown (one per reward, per crate…)
- Per player, not global — two players never share a cooldown
Chance chance
Rolls the dice: Pass fires the given percentage of the time, Fail otherwise. Crates, mystery rewards, random events. The percentage is an input pin — it can come from a variable (VIPs get better odds).
Get Variable getVar
Reads a variable. Scopes: session (this menu visit), player (permanent, survives restarts), global (server-wide, permanent). Unset variables read as empty/0 — safe to use before the first Set.
Get Element Value getValue
Reads a component's live state: 0–1 for progress bars and sliders, true/false for toggles and checkboxes, the typed text for input boxes. The read-side twin of Set Element Value.
Placeholder placeholder
Resolves any placeholder for the viewer — PlaceholderAPI, %player_…%, or NxGui's own %nxgui_…%. Two outputs: the raw Text, and a parsed Number you can feed straight into Math or Compare without conversion glue.
Player Info playerInfo
Common viewer facts without needing PlaceholderAPI: name · health · maxHealth · food · level · world · gamemode. Health ÷ maxHealth through Math makes a perfect Set Element Value feed for an HP bar.
Math math
add · sub · mul · div · mod · min · max · pow · round · floor · ceil · abs. Unary ops hide input B. Chain several for formulas — there's no expression parser on purpose; graphs stay readable.
Random Number random
A number between Min and Max. With Join Text and Set Element Text you have dice; with Compare you have a second, number-flavored way to do chance.
Join Text textJoin
Concatenates two values into text (numbers are formatted automatically). Chain multiple Joins for longer strings — prefix + placeholder + suffix is the classic pattern for labels and commands built at runtime.