Skip to content

Wizards of Lua — Commands

This document describes the available commands provided by the Wizards of Lua mod.


/lua <code>

Permission: wizardsoflua.lua (Default: Operator Level 2)
Argument: <code> – A string of Lua code to execute

Executes a Lua code snippet immediately as a spell.

Examples:

/lua print("Hello, " .. spell.owner.name)
/lua spell.block = Block:new("gold_block")
/lua for i = 1, 10 do spell:move("up"); spell.block = Block:new("glass") end
The first prints a greeting, the second places a gold block where you stand, and the third builds a glass pillar above you.

A spell runs until its code ends. This one runs until it is broken, and it is named, so that the /wol spell commands below can find it:

/lua spell.name = "clock"; while true do print(spell.world.time); sleep(100) end


/wol

Permission: wizardsoflua.wol (Default: Operator Level 2)

Serves as the parent command for Wizards of Lua management and configuration.


/wol extract api

Permission: wizardsoflua.wol.extract.api (Default: Operator Level 2)

Regenerates the Lua API documentation files in the config/wizards-of-lua/api directory.

Example:

/wol extract api
Point your editor's Lua extension at that directory, and it knows the Wizards of Lua API.


/wol extract examples

Permission: wizardsoflua.wol.extract.examples (Default: Operator Level 2)

Extracts the example files into the config/wizards-of-lua/examples directory. If that directory already contains files, the command refuses, so that nothing you added or changed there is lost.

Example:

/wol extract examples
/wol startup
The second command runs the examples' startup.lua files, which register their commands, e.g. /miner and /guards.


/wol extract examples overwrite

Permission: wizardsoflua.wol.extract.examples (Default: Operator Level 2)

Deletes everything in the config/wizards-of-lua/examples directory, including files you added or changed there, and then extracts the example files. Use it to get the examples of a new version of the mod.

Example:

/wol extract examples overwrite


/wol startup

Permission: wizardsoflua.wol.startup (Default: Operator Level 2)

Executes the startup sequence manually instead of during server startup. Upon execution, the mod stops all running spells then recursively searches for every startup.lua file, launching those in parent directories first and those in subdirectories afterward.

Example: after you changed a startup.lua, run it without restarting the server:

/wol startup


/wol spell break

Permission: wizardsoflua.wol.spell.break (Default: Operator Level 2)

Breaks all spells owned by the command source.

Example: break every spell you cast, e.g. the clock from the /lua example:

/wol spell break


/wol spell break all

Permission: wizardsoflua.wol.spell.break.all (Default: Operator Level 2)

Breaks all active spells.

Example:

/wol spell break all
This also breaks the spells of other players, and those started by startup.lua files, e.g. the ones that keep the examples' guards at their posts.


/wol spell break bySid <sid>

Permission: wizardsoflua.wol.spell.break.bySid (Default: Operator Level 2)
Argument: <sid> – The ID of the spell to break

Breaks a spell by its unique spell ID.

Example: /wol spell list shows each spell's ID, e.g. #12 clock: .... Break that one:

/wol spell break bySid 12


/wol spell break byName <name>

Permission: wizardsoflua.wol.spell.break.byName (Default: Operator Level 2)
Argument: <name> – The name of the spell to break

Breaks all spells with the given name. A name with spaces goes in double quotes.

Examples:

/wol spell break byName clock
/wol spell break byName "Miner 22"


/wol spell break byTag <tag>

Permission: wizardsoflua.wol.spell.break.byTag (Default: Operator Level 2)
Argument: <tag> – A tag of the spells to break

Breaks all spells that have the given tag (see Spell.tags).

Example: spells that belong together get the same tag, and then break together:

/lua spell:addTag("fireworks"); while true do spell:executeSilent("summon firework_rocket ~ ~ ~"); sleep(40) end
/lua spell:addTag("fireworks"); spell:move("north", 5); while true do spell:executeSilent("summon firework_rocket ~ ~ ~"); sleep(60) end
/wol spell break byTag fireworks


/wol spell break byOwner <player>

Permission: wizardsoflua.wol.spell.break.byOwner (Default: Operator Level 2)
Argument: <player> – The name of the player who owns the spell to break

Breaks all spells owned by the specified player.

Example:

/wol spell break byOwner Alex


/wol spell list

Permission: wizardsoflua.wol.spell.list (Default: Operator Level 2)

Lists all spells owned by the command source.

Example:

/wol spell list
Each line shows a spell's ID, its name and the beginning of its code, e.g. #12 clock: spell.name = "clock"; while true do ....


/wol spell list all

Permission: wizardsoflua.wol.spell.list.all (Default: Operator Level 2)

Lists all active spells.

Example:

/wol spell list all


/wol spell list bySid <sid>

Permission: wizardsoflua.wol.spell.list.bySid (Default: Operator Level 2)
Argument: <sid> – The ID of the spell to list

Lists a spell by its unique spell ID.

Example:

/wol spell list bySid 12


/wol spell list byName <name>

Permission: wizardsoflua.wol.spell.list.byName (Default: Operator Level 2)
Argument: <name> – The name of the spell to list

Lists all spells with the given name. A name with spaces goes in double quotes.

Examples:

/wol spell list byName clock
/wol spell list byName "Miner 22"


/wol spell list byTag <tag>

Permission: wizardsoflua.wol.spell.list.byTag (Default: Operator Level 2)
Argument: <tag> – A tag of the spells to list

Lists all spells that have the given tag (see Spell.tags).

Example: the spells of all miners from the Miner example, which tags them miner:

/wol spell list byTag miner


/wol spell list byOwner <player>

Permission: wizardsoflua.wol.spell.list.byOwner (Default: Operator Level 2)
Argument: <player> – The name of the player who owns the spell to list

Lists all spells owned by the specified player.

Example:

/wol spell list byOwner Alex


What’s next?