Skip to content

Trace

A Trace object is used to capture and inspect feedback messages generated by command execution. When passed to spell:execute, any textual output from the command will be collected into the trace.

Fields

content: string|nil Read-Only

The concatenated output messages if collected; nil if empty.

Methods

new() trace: Trace

Creates and returns a new Trace instance for capturing command feedback.

Example

local trace = Trace:new()
spell:execute("/data get entity @p", trace)
print("Command output:\n" .. trace.content)

Returns

  • Trace — trace A new, empty Trace object.