Anuken/Mindustry · warning · ValidateException
Player cannot respawn.
Error message
Player cannot respawn.
What it means
Thrown server-side as ValidateException in unitClear when netServer.admins.allowAction(respawn) returns false. Guards the respawn/leave-unit action behind the admin permission layer; a denied respawn aborts the packet.
Source
Thrown at core/src/mindustry/input/InputHandler.java:826
Time.run(Fx.unitSpirit.lifetime, () -> Fx.unitControl.at(unit.x, unit.y, 0f, unit));
if(!player.dead()){
Fx.unitSpirit.at(player.x, player.y, 0f, unit);
}
}else if(net.server()){
//reject forwarding the packet if the unit was dead, AI or team
throw new ValidateException(player, "Player attempted to control invalid unit.");
}
Events.fire(new UnitControlEvent(player, unit));
}
@Remote(targets = Loc.both, called = Loc.server, forward = true)
public static void unitClear(Player player){
if(player == null) return;
//make sure player is allowed to control the building
if(net.server() && !netServer.admins.allowAction(player, ActionType.respawn, action -> {})){
throw new ValidateException(player, "Player cannot respawn.");
}
if(!player.dead() && !player.unit().spawnedByCore){
var docked = player.unit().dockedType;
//get best core unit type as approximation
if(docked == null){
var closest = player.bestCore();
if(closest != null){
docked = ((CoreBlock)closest.block).unitType;
}
}
//respawn if necessary
if(docked != null && docked.coreUnitDock){
//TODO animation, etc
Fx.spawn.at(player);
View on GitHub (pinned to f695ad7e60)
Solutions
- Server: handle ValidateException as an expected denial rather than propagating.
- Review netServer.admins rules / permission plugin config if legitimate respawns are blocked.
- Clients can pre-check permissions if the server exposes them, otherwise expect possible denial.
Example fix
// before
Call.unitClear(player);
// after (server-side handler)
try{
// remote invocation path
}catch(ValidateException e){
Log.debug("@ denied respawn: @", e.player, e.getMessage());
} Defensive patterns
Strategy: try-catch
Validate before calling
// no generic client pre-check for permissions; clients may pre-check rules if exposed
if(/* server-exposed permission check */ false){ return; } Try / catch
try{ Call.unitClear(player); }catch(mindustry.net.ValidateException e){ Log.debug("rejected respawn from @", e.player); } Prevention
- Servers: handle ValidateException on respawn as expected.
- Document respawn permission rules for players.
- Avoid spamming respawn requests; rate-limit on the client.
- Review permission plugin config if valid respawns are denied.
When it happens
Trigger: Client sends unitClear (request to leave current unit / respawn at core) and the admin layer denies the respawn action. Server-side throw in the @Remote handler.
Common situations: Permission plugin restricts respawning; server config disables free respawn; a client spams respawn while a cooldown/permission blocks it.
Related errors
- Player cannot configure a tile.
- Player cannot control a building.
- Player cannot control a unit.
- Player attempted to control invalid unit.
- Map has no cores!
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/c4a186e3e8b03e79.
Report an issue: GitHub.