Running a server

Fake players

On this page

/fakeplayer puts a player on the server with no client behind it. It is for testing moderation, permissions, chat filters, claims and the like on a live server, without a second account or a second computer.

Turning it on

It is off by default:

# rustmc.yml
fake-players:
  enabled: true

While it is off, /fakeplayer is an unknown command and is not offered to anyone.

Settings

KeyDefaultMeaning
fake-players.enabledfalseOffers /fakeplayer to the console and level-4 operators

Commands

CommandDoes
/fakeplayer spawn <name> [<x> <y> <z> [<world>]]Joins a fake player called <name>
/fakeplayer remove <name>Takes it away, as if it had logged out
/fakeplayer listNames every fake on the server
/fakeplayer chat <name> <message>Says something in chat as it
/fakeplayer run <name> <command>Runs a command as it. A leading / is optional

The command works at the console, over RCON and in game.

NodeDefaultCovers
minecraft.command.fakeplayerlevel 4the command

Level 4 is the owners' level, the same as /stop.

Spawning

  • Where it appears. At the coordinates given; otherwise where you are standing, in your world; from the console, at the world spawn. ~ counts from the same place, so 0 ~ 0 keeps your height. A world can be named only after coordinates, as minecraft:the_nether or just the_nether, and it must exist.
  • The name must be 3 to 16 letters, digits or _, and must not belong to anyone already online.
  • It is let in as a client of that name would be. A banned name, a name not on an enforced whitelist, a full server and maintenance mode all refuse it, and the command says why. A name that is an operator's is refused too, so anything a fake runs is run at level 0.
  • It joins a moment later. The server first looks the name up at Mojang for its skin, then joins it. With no Mojang account of that name, or if the lookup fails, it has the default skin.

Names are not case-sensitive for remove, chat and run.

Speaking and running commands

chat sends the line through the same path a client's chat takes, so plugins, mutes and chat filters all see it. Its chat is unsigned, and is let through even where the server requires signed chat, because a fake has no key to sign with.

run sends the command as the fake's client would, so the fake's own permissions apply. Use it to check what a player without a rank can and cannot do.

How it behaves

  • It is a player to everything on the server. It joins and leaves through the same steps a client's join takes. It is in the tab list, other players see it, its join is announced, and the player_joined and player_left events fire for plugins. It can be kicked, banned, muted, teleported, hurt and killed. A kick or ban removes it. When it dies, it presses Respawn.
  • It stands still. A player's movement comes from their client, and a fake has none, so it does not walk or fall. It accepts every teleport, so /tp moves it.
  • It is never timed out. It counts as loaded from the moment it joins, and the server does not wait on it for keep-alives. Every packet the server sends it is dropped.
  • It takes a player slot. It counts towards max-players on this server, even though the server list does not show it.

What it never does

  • It is never saved. No player file, statistics or advancements are written for it, and it starts with nothing every time.
  • The outside world does not count it. It is left out of the server list's player count and sample, the query protocol's player names, and the players on the web map.
  • Plugins do see it as a player, because that is what it is for. On a network it is listed among the players, but no server's online count includes it.
  • It does not outlive the server. Every fake is removed at shutdown, while plugins can still see it leave.

Security and privacy

  • Its uuid is its own. It is derived from FakePlayer:<name>, a name no real account can have. Nothing a plugin keeps by uuid (a mute, a claim, a rank) carries over to or from the real account of that name.
  • Bans are kept by name, though. Banning a fake bans that name, real account included. A whitelist entry for a name lets a fake of that name in. Test with a name nobody plays under.
  • The name is sent to Mojang when a fake is spawned, to look up its skin.
  • Turn it off when you are done. Anyone at level 4 can put a player on the server that looks real to everyone else in the game, and make it chat.

From docs/fake-players.md in the RustMC repository at bbd81209ad.