Table of Contents

Component: Debug

This component is provided by the Debug Card.

Component name: debug.

The Debug Card, which is only available in creative mode, provides a set of fairly dangerous functionality for use in setting things up to debug and test code. Do not use the Debug Card without backups. No, really. One time I accidentally converted a vertical slice of the world entirely to Sign objects with no writing on them.

The debug card's “container” refers to the robot, computer or tablet with a debug card installed in it.

On a dedicated server the debug card must be bound to a player by shift-right-clicking with it to run commands using the runCommand callback. The bound player needs to have permission to use the command provided to runCommand.

Callbacks:

local debug = require("component").debug
local serialize = require("serialization").serialize
local x, y, z = debug.getX, debug.getY, debug.getZ
local offset_x = -1
local offset_z = 0
local blocking, label, content = debug.scanContentsAt(x() - .5 + offset_x, y() - .5, z() - .5 + offset_z)
print(blocking, label, serialize(content))

World Object

The world object reflects the current world (dimension) the container is in.

Player Object

A player object represents a given player in the world.

Scoreboard Object