ServerReplay
A completely server-side Minecraft fabric mod that allows you to record replays for replay mod or flashback. This mod allows you to record multiple players that are online on a server at a time, as well as any given chunk area. This will produce replay files which can then be used with the respective mod for viewing/rendering.
Install / Use
/learn @senseiwells/ServerReplayREADME
<img src="./src/main/resources/assets/server-replay/icon.png" align="center" width="64px"/> Server Replay
English | 中文
A completely server-side implementation of Replay Mod and Flashback, this mod allows you to record multiple players that are online, or chunk areas, on a server at a time. This will produce replay files which can then be used with the replay mod or flashback for rendering.
Why Server-Side?
Compared to the client Replay Mod or Flashback recording server-side has many benefits:
- The ability to record static chunks.
- You can specify the exact chunk size (not bound by server view distance).
- The recorded chunks may be unloaded without affecting the replay.
- No chunk flickering (from unloading and loading the chunks).
- The chunks will also not be loaded by the recorder (like, for example, PCRC).
- Pause and resume the recorders based on whether the chunks are being loaded or whether there are players in the chunks
- The ability to record individual players.
- Players aren't required to install replay mod or flashback.
- You can record all POVs at once.
- Recordings can be automated using the configuration.
- Recordings can be started at anytime by operators (or anyone with permissions).
However, there are also some downsides and known issues:
- Some features are not recorded by chunk recordings, e.g. custom boss bars.
- Player recordings may not be 100% consistent with the client Replay Mod or Flashback.
- ServerReplay isn't really designed for heavily modded servers.
More complex mods that implement their own packets may not be compatible.
- If you encounter any compatability issues, please submit an issue.
Usage
This mod requires the fabric launcher, fabric-api, and fabric-kotlin.
There are two ways of recording on the server, you can either configure it to follow and record players from their view. Alternatively, you can record a static area of chunks.
Quick Start
[!NOTE] This documentation is for the latest version of the mod, for older versions of the mod please see the other branches
This section of the documentation will briefly guide you through a basic setup. As well as containing some important information.
Players
To record a player on your server you can run /replay start players <player(s)>, for example:
/replay start players senseiwells
/replay start players @a
/replay start players @a[gamemode=survival]
Player recorders are tied to the player and will record at the servers view distance.
If the player leaves or the server stops, the replay will automatically stop and save.
Alternatively if you wish to stop the recording manually you can run /replay stop players <player(s)> <save?>,
using this command you can also stop a recording without saving it, for example:
/replay stop players senseiwells
/replay stop players @r
/replay stop players senseiwells false
The replay will then be saved to your "player_recording_path" location
specified in a folder with the player's uuid.
By default, this will be in ./recordings/players/<uuid>/<date-and-time>.mcpr.
This file can then be put in ./replay_recordings on your client and be opened with replay mod.
[!WARNING] Trying to record carpet bots or other non-real players may lead to unexpected behaviour. If you want to record a large chunk area please use a chunk recorder instead!
Chunks
[!NOTE] While the mod will record the chunks you specify, the Minecraft client will not render the outermost chunks. So to record an area of visible chunks, you must add one chunk to your border, e.g. recording a visible area from
-5, -5to5, 5you must record between-6, -6and6, 6.
To record an area of chunks on your server you can run /replay start chunks from <chunkFromX> <chunkFromZ> to <chunkToX> <chunkToZ> in <dimension?> named <name?>, for example:
/replay start chunks from -5 -5 to 5 5 in minecraft:overworld named MyChunkRecording
/replay start chunks from 54 67 to 109 124
/replay start chunks from 30 30 to 60 60 in minecraft:the_nether
Alternatively you can specify a chunk and a radius around it to be recorded /replay start chunks around <chunkX> <chunkZ> radius <radius> in <dimension?> named <name?>, for example:
/replay start chunks around 0 0 radius 5
/replay start chunks around 67 12 radius 16 in minecraft:overworld named Perimeter Recorder
Chunk recorders are static and cannot move, they record the specified chunks. An important thing to note is that when the replay starts, the specified chunks will be loaded (and generated if necessary). However, after this, the chunk recorder does not load the chunks.
You can further configure this with the
"chunk_recorder_load_radius" setting, which will set a maximum initial radius
that the chunk recorder will load, any chunks outside this radius that are recorded
will need to be loaded 'naturally' to be recorded.
If the server stops, the replay will automatically stop and save.
Alternatively if you wish to stop the recording manually you can stop a specified
recorder using its name with /replay stop chunks named <name> <save?>, for example:
/replay stop chunks named "Perimeter Recorder" false
/replay stop chunks named MyChunkRecording
The replay will then be saved to your "chunk_recording_path" location
specified in a folder with the chunk recorders name.
By default, this will be in ./recordings/chunks/<name>/<date-and-time>.mcpr.
This file can then be put in ./replay_recordings on your client and be opened with replay mod.
Encoding
ServerReplay supports flashback (for the more recent versions), as well as replay mod replays.
By default, all recordings will be recorded using replay mod's format; however, you can change this by running the following commands in game:
/replay encoding default set flashback
/replay encoding default set replay_mod
[!NOTE] You can record a player's perspective using both flashback and replay-mod simultaneously. You can do this by setting the default encoding to flashback, starting a recording, then setting the encoding to replay_mod and starting another recording.
The same can be done for chunk recordings, but each recorder must be given a unique name.
Viewing
After a replay has finished recording, you are able to view the replay completely server-side. The player viewing the replay will be completely removed from the actual server while they view the replay, and will be treated as if they are offline.
Essentially, this just "runs" another server that sends the client packets. This runs asynchronously from the main server, so there is little to no impact on performance.
When a replay has finished recording, you can click on the green text in chat to view the
replay that just finished.
The command to view chunk replays is: /replay view chunks <name> <date-time>, and for players:
/replay view players <uuid> <date-time>, for example:
/replay view player "d4fca8c4-e083-4300-9a73-bf438847861c" "2024-05-11--19-19-55"
/replay vi
