Variable scopes
Global names and values local to the current event.
Naming rules
| Java name | Skript variable | Scope |
|---|---|---|
score or {score} |
{score} |
Global |
_score or {_score} |
{_score} |
Current event |
items::* |
{items::*} |
Global tree |
_items::* |
{_items::*} |
Local tree |
The bridge does not search local scope before global scope: the _ prefix selects the scope.
Lifetime
Local variables belong to an event object. A separate command invocation is another event and cannot access the previous invocation’s local values. Globals use ordinary Skript storage; persistence depends on Skript’s storage settings and value types.
The 2.0.0 correction
The old bridge passed braced names to the raw API, producing incorrect scopes and reads. SkJvm 2.0.0 corrects this. Review which values should be server-wide and which belong to one event when upgrading.