handleQuery

public ScriptQueryResult handleQuery(ScriptHook hook, Event event, LivingEntity directTarget, LivingEntity eventActor)

Invokes a Lua hook synchronously and returns its immutable scalar result.

The hook runs in the same VM, context, ownership lifecycle, and execution watchdog as ordinary events. Returning a table, function, userdata, or thread is a contract failure: the script is logged, shut down, and FAILED is returned.