ScriptInstance
Represents a running instance of a Lua script bound to a ScriptableEntity.
Manages the Lua VM lifecycle, per-entity state, task ownership, and hook dispatch. The Lua table is lazily instantiated on the first event or query hook call.
Properties
Functions
Link copied to clipboard
Cancel an owned task by id.
Link copied to clipboard
Link copied to clipboard
The direct target of the event being dispatched, or null (e.g.
Link copied to clipboard
The event currently being dispatched, or null (e.g.
Link copied to clipboard
The actor (e.g.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public void handleEvent(ScriptHook hook, Event event, LivingEntity directTarget, LivingEntity eventActor)
Invokes the Lua hook function with a lazily-built context table.
Link copied to clipboard
public ScriptQueryResult handleQuery(ScriptHook hook, Event event, LivingEntity directTarget, LivingEntity eventActor)
Invokes a Lua hook synchronously and returns its immutable scalar result.
Link copied to clipboard
Allows a single-input host to release an idle activation without counting its own lifetime guard.
Link copied to clipboard
Invoke a Lua callback with explicit args under the CPU-time/instruction watchdog.
Link copied to clipboard
Link copied to clipboard
Register optional Java-owned restoration.
Link copied to clipboard
Schedule a one-shot owned Lua callback, invoked with a fresh context table.
Link copied to clipboard
Schedule a repeating owned Lua callback, each invoked with a fresh context table.
Link copied to clipboard
Schedule a repeating owned Java task; auto-cancelled on shutdown.
Link copied to clipboard