Turning Off Client Mods
An approved server can turn off a player's Fabric mods for as long as the player stays connected. Dawn turns them off without a restart and turns them back on when the player leaves. Nothing changes in the player's profile.
This is separate from the FeatherPlayer mod methods on the Mods page, which manage Dawn's built-in mods.
#Requirements
- An approved server. Dawn keeps an allowlist of approved server domains and checks the address the player connected to against it. Approval covers the domain and its subdomains. IP addresses never match, so players have to join through the approved domain.
- A supported client. Dawn for Fabric on Minecraft 1.21.5 and newer. This is rolling out now: players need a Dawn build released after November 30, 2026. Players on an older build, another mod loader or an older Minecraft version don't answer on the channel, and nothing is turned off for them. While it rolls out, some clients refuse every mod the player has as
unavailable.
#What players see
- One notice when the mods go off, such as "play.example.com turned off 2 mods".
- While the player is connected, those mods show as off and locked in the game's mod list.
- The mods come back on when the player leaves the server.
#Channel
Messages go over the plugin channel dawn:mods, without the Dawn server API's own envelope. The messaging artifact has a codec for them, gg.dawn.serverapi.messaging.DawnModsChannel, from Server API 0.0.11.
public final class ForbiddenMods implements PluginMessageListener {
private static final List<String> FORBIDDEN = Arrays.asList("freecam", "xaerominimap");
private final Plugin plugin;
private final Map<UUID, Integer> latest = new HashMap<>();
private final Set<UUID> retried = new HashSet<>();
public ForbiddenMods(Plugin plugin) {
this.plugin = plugin;
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, DawnModsChannel.CHANNEL);
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, DawnModsChannel.CHANNEL, this);
}
@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
DawnModsChannel.Message read = DawnModsChannel.read(message);
if (read instanceof DawnModsChannel.ModList) {
retried.remove(player.getUniqueId());
send(player);
} else if (read instanceof DawnModsChannel.Result) {
DawnModsChannel.Result result = (DawnModsChannel.Result) read;
if (!Integer.valueOf(result.requestId).equals(latest.get(player.getUniqueId()))) {
return;
}
if (result.retryLater() && retried.add(player.getUniqueId())) {
Bukkit.getScheduler().runTaskLater(plugin, () -> send(player), 100L);
return;
}
List<String> stillOn = result.stillOn();
if (!stillOn.isEmpty()) {
player.kickPlayer("Please remove " + String.join(", ", stillOn));
}
}
}
private void send(Player player) {
int requestId = latest.merge(player.getUniqueId(), 1, Integer::sum);
player.sendPluginMessage(plugin, DawnModsChannel.CHANNEL, DawnModsChannel.disable(requestId, FORBIDDEN));
}
}#Messages
| From | Message | What it does |
|---|---|---|
| Server | DawnModsChannel.query() | Asks for the client's mod list. The client answers with a ModList. |
| Server | DawnModsChannel.disable(requestId, ids) | Sets the mods to keep off. A new list replaces the old one, and an empty list turns everything back on. The client answers with a Result. |
| Client | ModList | Every loaded mod, with its version and whether it is off, off because of this server, or can never be turned off. The client also sends it when it joins an approved server that registered the channel. |
| Client | Result | Echoes the requestId, and lists every id from the request, either in off or in refused with a reason. Requests are answered in order; if you send more than one, use a new requestId each time and act on the latest Result. |
Ids must be Fabric mod ids ([a-z][a-z0-9_-]{1,63}). Result.stillOn() lists the mods that were asked for and are still running. Refusal reasons include:
absent: the player doesn't have the mod.core: Dawn, Fabric API, renderers and other mods that never turn off.needed: other running mods need it. Name them too.unavailable: the player has the mod, but this client can't turn mods off.failed: Dawn tried and rolled back.changed: the mod was in the middle of another change, such as coming back on after the previous server. This is temporary:Result.retryLater()is true, so senddisableagain a few seconds later before kicking, as the example does.
Dawn may add more reasons, so treat any reason you don't know as a refusal.
The first change can take a few seconds. Allow about 15 seconds for the Result before treating it as a refusal.
When a proxy moves the player to another backend, the mods stay off. Every backend that cares should send its own list, and an empty list turns the mods back on.