Add doc_items support

master
Wuzzy 2018-01-16 22:25:17 +01:00
parent 3ab7572f3c
commit e46331f954
1 changed files with 26 additions and 0 deletions

View File

@ -153,6 +153,32 @@ end
minetest.register_tool("cmdtool:cmdtool", {
description = DESCRIPTION,
_doc_items_longdesc = "This is a programmable tool which can be used to run server commands.",
_doc_items_usagehelp = [[This tool is very mighty, so handle with care!
Rightclick to set the commands. Write a list of server commands you wish to execute (with one command per line), in that order, but without the trailing slash like in the chat. Confirm with the OK button.
To run the commands, use the attack key. Note that commands might fail if you lack the required privileges or you made a mistake.
Optionally, you can use the following placeholders to insert variable values into your commands:
@playername: Your player name
@plx, @ply and @plz: Your player coordinates
@@: Literal at sign
These placeholders only work when you use the tool on a block.
@ptx, @pty and @ptz: Coordinates of the pointed node (i.e. block)
@nodename: Itemstring of the pointed node
@param2: param2 of the pointed node
Refer to Advancd usage > Server commands to learn more about server commands.
Example 1:
time 12000
Sets time to midday.
Example 2:
teleport @plx 9 @plz
giveme default:apple
Teleports you to Y=9 without changing the X and Z coordinates, then gives you an apple.]],
inventory_image = "cmdtool_cmdtool.png",
wield_imagee = "cmdtool_cmdtool.png",
on_use = execute_command,