wiki:Console Commands

Version 24 (modified by Alloc, 6 years ago) (diff)


Console Commands

In order to do some bits of administration or even for informational purposes 7 Days to Die integrates a console system. This can be accessed in three ways:

  • In game by a client. The key to open the console F1 since A15
  • "Telnet". This has to be enabled server side and can then be accessed with a simple Telnet client (not a real Telnet server but a raw text interface)
  • Web control panel. Has to be enabled server side too and can then be accessed with any web browser

admins.xml and in game console

  • Any player not given a specific permission level in admins.xml will have a default level of 1000
  • A command with permission level of >=1000 can be executed by any player that is either defined with a permission level of <=1000 or not listed in the admins.xml at all
  • Any command not having an permission level set in admins.xml will automatically have a permission level of 0
  • Commands defined in the admins.xml affect both short and long versions

Example: admins.xml:

<?xml version="1.0" encoding="UTF-8"?>
        <admin steamID="123456" permission_level="0" />
        <admin steamID="987654" permission_level="4" />

        <permission cmd="dm" permission_level="3" />
        <permission cmd="mem" permission_level="4" />
        <permission cmd="admin" permission_level="0" />
        <permission cmd="kick" permission_level="5" />
        <permission cmd="lt" permission_level="10" />
        <permission cmd="setgameprefs" permission_level="0" />
        <permission cmd="le" permission_level="1000" />
  • Player with ID 123456 (permission level 0):
    • dm -> ok
    • mem -> ok
    • admin -> ok
    • sg (which is the short version of setgameprefs) -> ok (setgameprefs is defined so it also affects sg)
    • shutdown -> ok (implicitly defined as permission level 0)
  • Player with ID 987654 (permission level 4):
    • dm -> denied (dm requires permission level of 3 or less)
    • mem -> ok
    • kick -> ok
    • le -> ok
  • Any other player with no defined permission level:
    • le -> ok (permission level 1000 -> any player can execute this command)
    • any other command -> denied

Managing permissions by commands

Each of the sections of admins.xml can be modified through console commands while the server is running. These are:

  • admin: Manage the list of players which should be admins
  • cp: Manage command permission level definitions (in the XML those are the permissions->permission-elements)
  • whitelist: Whitelisted players. Note: if there is at least one whitelisted player only players on this list can join the server whatsoever.
  • ban: Ban a player (XML: blacklist elements)

All commands have three subcommands given as their first parameter:

  • add: Add/update a player/command to/on the given list
  • remove: Remove a player from the given list
  • list: List all currently defined entries

Implemented commands

This is typically outdated as commands change all the time. Refer to the output of the console command help and help <command name> for always up-to-date information'''

Command Parameters Description
admin add <playername> <permissionLevel> Add a player as admin with the given permissionlevel
admin remove <playername> Remove the admin rights of a player
aiddebug Toggles AIDirector debug output
ban <playername> <duration> <unit> Bans user for period specified by duration and unit. Unit can be anything of: minutes, hours, days, weeks, months, years
buff <buffName> Applies a buff to the local player
chunkcache, cc Shows all loaded chunks in cache
convertdtm ?
cp add <command> <permissionLevel> Add the definition of a permission level for a given command
cp remove <command> Remove the command permission level definition
creativemenu, cm <0/1> Disable/Enable the creative menu for the local player
debuff <buffName> Removes a buff from the local player
debugmenu, dm Enables/disables debug menu for a client
enablescope, es Toggle debug scope
gameover, go Sets the game state to GameOver
generatemap, gm Generates a 2D map image of the current world.
getgamepref, gg [<match>] Get all preferences that contain the given string or all preferences if no string is given
gettime, gt Retrieves current ingame time
give <playername|entityid> <itemname> <amount> Give an item to a player (check for possible item names with listitems) (Added by the Server fixes)
kick <playername> [<reason>] Kicks user with optional reason
kill <playername or entityId> Kill the given player
listents, le List all entities
listitems, li <searchString> List all items that can be given with give that match contain the searchString (Added by the Server fixes)
listknownplayers, lkp [-online | -notbanned | <searchString>] List all players that have ever been online, optionally filtered (Added by the Server fixes)
listlandprotection, llp nearby [<entityid>] INGAME ONLY Lists all land protection blocks and their owners that are placed near the current player. Default distance is 32 in both x and z. Can optionally be passed another distance (Added by the Server fixes)
listlandprotection, llp [summary | <steamid> | <entityid> | <playername>] Lists all land protection blocks and their owners. If summary is passed it only shows the number of keystones per player, if any of the other is passed it only shows the keystones of the given player (Added by the Server fixes)
listplayers, lp List all players
listthreads, lt Lists all game threads
mem Print information about current memory consumption of the server and call garbage collector
removelandprotection, rlp <steamid> OR <x> <y> <z> Removes the given land protection block or all blocks of a given player. Note that the chunk which contains the keystones has to be loaded at that moment (i.e. get close to the keystones before executing this command) (Added by the Server fixes)
rendermap, rm Render the map as far as it was visited by players (Added by the Server fixes) READ INFORMATION ON THIS ON THE SERVER FIXES PAGE!
reply, re <message> Send a message to the user from whom you last received a PM (Added by the Server fixes)
saveworld, sa Saves the world manually
say <message> Sends a message to all connected clients
sayplayer, pm <playerName or entityId> <message> Send a message to a single player (Added by the Server fixes)
setgamepref, sg [<prefName> [<value>]] Retrieves (if no value given) or sets a game preference. If both parameters are left out all preferences are shown. Does not work with most settings!
settime, st [<time>] or <day> <hour> <minute> Set the time. If no time is given it will set to Day 1, 08:00. time can be "day" which will set to Day 1, 16:00, or "night" which will set it to Day 2, 05:00. Or it can be a positive integer value, specifying the time relative to Day 1, 08:00
showchunkdata, sc Shows some data of the current chunk
showinventory, si <steamid or playerName or entityId> List inventory of the given player (Added by the Server fixes)
shownexthordetime Displays the wandering horde time
shutdown Shut down the server
smoothworld, sw [<typeToFix> [<passes>]] Smoothens the world, one iteration at a time. typeToFix can be one of land, air, or fix. land is default.
sounddebug Toggles SoundManager debug output
spawnairdrop Spawns an air drop
spawnentity, se [<playerId> <entityId>] Spawn an entity of type entityId near the player with playerId. To get a list of all player/entity IDs run without any parameter.
spawnsupplycrate Spawns a supply crate where the player is (only works for client run servers / singleplayer)
spawnwanderinghorde Spawns a wandering horde of zombies
teleportplayer, tele <steamid or playerName or entityId> {<steamid or playerName or entityId> OR <x> <y> <z>} Teleport the player to the given location or to the given player (Added by the Server fixes)
version Get the currently running version of the game and loaded mods
whitelist add <playername> <permissionLevel> Add a player to the whitelist with the given level
whitelist remove <playername> Remove a player from the whitelist