Difference between revisions of "Server commands"

From Luanti Wiki
Jump to navigation Jump to search
(→‎Kill: fix font)
(Replaced content with "[https://dev.luanti.org/server-commands/ This page has moved to the Luanti Developer Wiki]")
Tag: Replaced
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Languages}}
+
[https://dev.luanti.org/server-commands/ This page has moved to the Luanti Developer Wiki]
 
 
'''Server commands''' (also called “'''chat commands'''”) are special commands to the server that can be entered by any player via the [[chat]] to cause the server to do something. There are a few commands which can be issued by everyone, but some commands only work if you have certain [[privileges]] granted on the server. Use “/privs” to see your own privileges. If not noted otherwise, the commands in this article are assumed to require no privileges. This article will only cover the commands which are built-in into Minetest 0.4.10 and in [[Games/Minetest Game|Minetest Game]]. Other mods and games may add additional commands; refer to the mod’s documentation or use “/help all” in this case.
 
== Issuing a command ==
 
To issue a command, simply type it like a [[Chat|chat]] message or use the [[console]]. Alternatively, you can just press the “/” key (only in default [[Controls|controls]]) which simply opens a [[chat window]] where the “/” has already been typed for you and then type the command right away. The command itself will ''not'' appear in the chat. Since every command starts with “/”, this means that ordinary chat messages can’t start with “/”; they will be interpreted as a command instead, even if such a command does not exist. You can tell whether or not a command was successful by the server’s response. If you see something “<code>-!- Invalid command: /blargh</code>” in the chat, you probably misspelled something. The most commands will cause the server to write you something else on the chat log for you, if successful.
 
 
 
== Issuing a command from the system terminal ==
 
To issue commands on a Minetest server instance started from the terminal, Minetest has to be built with the [https://www.gnu.org/software/ncurses/ ncurses] library enabled. When minetestserver is started with the <code>--terminal</code> argument, commands can be executed as they are in-game; i.e. <code>/<command></code>
 
 
 
== General syntax ==
 
 
 
All commands start with “/”. After that, one word follows which is itself followed by some or none arguments. You’ll find the exact syntax in the command reference.
 
In the following command reference, text enclosed in <code><></code> is a placeholder for an actual value. Anything written in <code>[]</code> can be omitted.
 
 
 
== Command reference of built-in commands ==
 
The commands listed here are always available, regardless of the mods and [[Games|games]] you have installed.
 
 
 
=== Quick documentation ===
 
 
 
Show short documentation of server commands and privileges; it will appear in the chat log, too. In case the help is too long, you can open the console with F10 to view everything again.
 
* <code>/help</code>—Shows a list of the available commands—depending on your privileges—on the server
 
* <code>/help <command></code>—Shows short description about the given command. You can view the help of a command even if you do not have the privilege to issue it
 
* <code>/help all</code>—Lists the available commands—depending on your privileges—on the server and a short description and syntax reference to each one
 
* <code>/help privs</code>—Lists all privileges on the server that could possibly be granted to players and shows a short description about each of them
 
 
 
=== Player-related ===
 
 
 
==== Informational ====
 
 
 
* <code>/privs [<player>]</code>—List of privileges granted to <player>, if not specified, your own privileges
 
* <code>/haspriv <privilege>—List all online players that have the specified privilege
 
* <code>/last-login [<player>]</code>—Show the date and time when <player> has logged in the last time into this server ([https://en.wikipedia.org/wiki/Coordinated_Universal_Time UTC] time zone, [https://en.wikipedia.org/wiki/ISO_8601 ISO 8601] format). If not specified, shows your own last login time
 
 
 
==== Chat ====
 
 
 
These commands require the “shout” privilege to work.
 
* <code>/msg <player> <message></code>—Send a private message <message> to <player>; but not to the other players. '''Note''': The message is not encrypted. Do not use this to send highly sensitive information
 
* <code>/me <action></code>—Makes a text in the format “* <your name> <action>” appear in the chat log. E.g. “/me eats pizza.” leads to “* Alfred eats pizza.” (if your name is “Alfred”)
 
See [[Chat]] for details
 
 
 
==== Items ====
 
 
 
* <code>/give <player> <itemstring> [<count> [<wear>]]</code>—Give the specified item (see [[Itemstrings]]) <count> times (default: 1) to the player. <wear> specifies the damage for tools (0-65535) and is meaningless for other items, higher means more damage (default: 0). Requires the “give” privilege
 
* <code>/giveme <itemstring> [<count> [<wear>]]</code>—Give item to yourself. <count> and <wear> have the same meaning as for /give. Requires the “give” privilege.
 
* <code>/pulverize</code>—Destroys the wielded item. Can be used by any player
 
* <code>/clearinv [<name>]</code>—Destroys all items in your inventory (no argument provided) or in someone else's inventory (<code>name</code> provided). To clear someone else's inventory, you need the “server” privilege
 
 
 
'''Hint''': Negative numbers for <count> and <wear> will count down from 65536, so you can use -1 as shorthand for 65535, the maximum possible value.
 
 
 
===== Examples =====
 
 
 
* <code>/giveme default:torch</code>—Gives you a [[torch]]
 
* <code>/give Peter default:cobble 50</code>—Gives Peter 50 [[cobblestone]]
 
* <code>/giveme default:pick_steel 1 16383</code>—Gives you a steel [[pickaxe]] which is about 25% worn-off
 
 
 
==== Teleportation ====
 
 
 
Teleportation is the immediate displacement of any player to a given position. All of the following commands require the “teleport” privilege
 
* <code>/teleport <x>,<y>,<z></code>—Teleports yourself to given [[coordinates]]
 
* <code>/teleport <target_player></code>—Teleports yourself to the player with the name <target_player>
 
* <code>/teleport <player> <x>,<y>,<z></code>—Teleports <player> to given coordinates. Also requires the “bring” privilege
 
* <code>/teleport <player1> <player2></code>—Teleports <player1> to <player2>. Also requires the “bring” privilege
 
 
 
[[Games/Minetest Game|Minetest Game]] also provides the command “<code>/home</code>”. See [[#Command reference for Minetest Game commands]]
 
 
 
==== Kill ====
 
* <code>/kill [<name>]</code>: Kill player or yourself (requires “<code>server</code>” privilege
 
 
 
=== Moderation ===
 
 
 
==== Password manipulation ====
 
 
 
These commands allow to set and reset the passwords of any player and require the “password” privilege to work.
 
* <code>/setpassword <player> <password></code>—Sets password of <player> to <password>
 
* <code>/clearpassword <player></code>—Makes password of <player> empty
 
 
 
==== Privilege manipulation ====
 
 
 
All these commands require you to have the “privs” (to manipulate all privileges) or “basic_privs” (to manipulate “interact” and “shout” privileges) privilege.
 
* <code>/grant <player> <privilege></code>—Gives the <privilege> to <player>
 
* <code>/grant <player> all</code>—Give all available privileges to <player>
 
* <code>/grantme <privilege></code>—Give <privilege> to yourself
 
* <code>/grantme all</code>—Gives all privilege to yourself
 
* <code>/revoke <player> <privilege></code>—Takes away a <privilege> from <player>
 
* <code>/revoke <player> all</code>—Takes away as many privileges as possible from <player>
 
 
 
==== Excluding players from server ====
 
These commands allow the user to kick, ban and unban players. Kicking a player means to remove a connected player from the server. This requires the “kick” privilege. Banning a player prevents him/her to connect to the server again. The player does not need to be connected at this time. Unbanning means to remove a ban from a player, allowing him/her to connect to the server again. The ban and unban commands require the “ban” privilege.
 
* <code>/kick <player name> [<reason>]</code> – Kicks the player with the name <player name>. Optionally a <reason> can be provided in text-form. This text is also shown to the kicked player.
 
* <code>/ban</code> - show list of banned players
 
* <code>/ban <player name></code>—Ban IP of player
 
* <code>/unban <player name></code>—Remove ban of player with the specified name
 
* <code>/unban <IP address></code>—Remove ban of player with the specified IP address
 
 
 
=== Server-related ===
 
 
 
==== Informational ====
 
 
 
Request some information from the server; the answer from the server will also be written into the chatlog.
 
 
 
* <code>/admin</code>—Player name of the administrator / server operator of the server you're connected to.
 
* <code>/status</code>—Server’s Minetest version, time the server is running in seconds (called “uptime”), list of connected players and the [[Message Of The Day|message of the day]] (if it exists).
 
* <code>/mods</code>—List of mods installed on the server.
 
* <code>/days</code>—Current game day (counting starts at 0)
 
* <code>/time</code>—Current game time (24h clock)
 
 
 
==== World manipulation ====
 
 
 
* <code>/time <nowiki><hours>:<minutes></nowiki></code>—Sets the [[Time of day|time of day]] in the 24-hour format (0:00-23:59). Requires the “settime” privilege
 
* <code>/time <nowiki><time_of_day></nowiki></code>—Sets the [[Time of day|time of day]] as a number between 0 and 24000 (see [[time of day]]). Requires the “settime” privilege
 
* <code>/set -n time_speed <speed></code>—Sets the speed of [[Day/night cycle|day/night cycle]] where <code><speed></code> is the time speed (read as “<code><speed></code> times faster than in real life”). 72 is the default, which means a day-night cycle lasts 20 minutes by default. Requires the “server” privilege
 
* <code>/spawnentity <entity> [<X>,<Y>,<Z>]</code>—Spawns an [http://dev.minetest.net/LuaEntitySAO#Lua_Entity entity] of type <entity> (see [[List of entity names]]) near your position or at the X,Y,Z coordinates, if specified. If you enter an invalid entity name, this will spawn an [[Unknown Object|unknown object]]. Requires “give” and “interact” privileges
 
 
 
==== Server maintenance ====
 
 
 
All of these commands require the “server” privilege.
 
* <code>/shutdown</code>—Shuts down the server
 
* <code>/set <variable></code>—Shows the value of the given server <variable> (→[[minetest.conf]])
 
* <code>/set <variable> <new value></code>—Sets the existing server <variable> to the given <new value>
 
* <code>/set -n <variable> <initial value></code>—Creates a new server variable named <variable> and sets it to <initial value>
 
* <code>/clearobjects [full|quick]</code>—Clears all objects/entities (removes all dropped [[items]], [[mobs]] and possibly more). Note this may crash the server or slow it down to a crawl for 10 to more than 60 seconds
 
* <code>/auth_reload</code>—Reloads ''auth.txt'', which is the authentication data, containing privileges and Base64-scrambled passwords
 
* <code>/emergeblocks here [<radius>]</code>—Starts loading (or generating, if inexistent) map blocks around the player's current position with an optional radius (in nodes)
 
* <code>/emergeblocks <pos1> <pos2></code>—Starts loading (or generating, if inexistent) map blocks contained in the area within pos1 and pos2
 
* <code>/fixlight here [<radius>]</code>—Resets lighting around the player's current position with an optional radius (in nodes)
 
* <code>/fixlight <pos1> <pos2></code>—Resets lighting contained in the area within pos1 and pos2
 
* <code>/deleteblocks here [<radius>]</code>—Removes the MapBlock the player is in, from the database. As this triggers mapgen, this might start mechanisms like mud reflow or cavegen which very likely affect mapblocks outside the specified range. 113 blocks are a safe-distance for a server with no interfering mods. <code><radius></code> is an optional argument to specify the range (in nodes) in which MapBlocks are deleted
 
* <code>/deleteblocks <pos1> <pos2></code>—Removes the MapBlock containing blocks inside the area from pos1 to pos2 from the database. May crash for larger areas. Warnings from above apply
 
* <code>/remove_player <name></code>—Removes all data accociated to the given player. This only works if the player is currently not connected. If a player with this name connects again, he/she will be treated as a complete new player. Password, inventory, position, etc. are all gone
 
 
 
=== Rollback === <!--FIXME: poorly documented.-->
 
 
 
Allows to use [[Rollback]]. Requires the “rollback” privilege.
 
* <code>/rollback_check [<range>] [<seconds>]</code>—Checks who has last touched a node or near it, max. <seconds> ago (default <range>=0, default <seconds>=86400, which equals 24 hours in real time).
 
* <code>/rollback <player name> [<seconds>]</code>—Reverts actions of a player; default for <seconds> is 60
 
* <code>/rollback :<actor name> [<seconds>]</code>—Reverts actions of an actor ''(not a player)''; default for <seconds> is 60
 
 
 
== Command reference for Minetest Game commands ==
 
If you use Minetest Game, a few additional commands are available. These commands may not be available if you use a different [[Games]].
 
 
 
* <code>/sethome</code>—Sets your current position as your “home point”. Requires the “home” privilege
 
* <code>/home</code>—Teleports yourself to your “home point”. This command does not work if you haven’t set your “home point” yet, set it with <code>/sethome</code> first. Requires the “home” privilege
 
* <code>/killme</code>—Kills yourself
 
 
 
[[Category:Server]]
 
[[Category:Commands]]
 

Latest revision as of 20:52, 31 December 2024