Anuken/Mindustry · error · ArcRuntimeException
Unknown UI entry type:
Error message
Unknown UI entry type:
What it means
readMenuResult()'s per-entry type switch accepts only 0 (float), 1 (boolean), and 2 (string). Any other type byte hits the default and throws ArcRuntimeException. An unknown type indicates a corrupt, incompatible, or malicious menu-result packet.
Source
Thrown at core/src/mindustry/io/TypeIO.java:342
if(entries > MenuResult.maxTotalValues) throw new ArcRuntimeException("UI result entry count exceeds max entries: " + entries);
for(int i = 0; i < entries; i++){
if(remainingChars <= 0) throw new ArcRuntimeException("Too many long strings in MenuResult, reduce your amount of elements/IDs.");
String key = read.str(Math.min(remainingChars, MenuResult.maxValueLen));
remainingChars -= key.length();
byte type = read.b();
switch(type){
case 0 -> result.values.put(key, read.f());
case 1 -> result.values.put(key, read.bool());
case 2 -> {
if(remainingChars <= 0) throw new ArcRuntimeException("Too many long strings in MenuResult, reduce your amount of elements/IDs.");
String value = read.str(Math.min(remainingChars, MenuResult.maxValueLen));
remainingChars -= value.length();
result.values.put(key, value);
}
default -> throw new ArcRuntimeException("Unknown UI entry type: " + type);
}
}
return result;
}
public static void writePayload(Writes writes, Payload payload){
Payload.write(payload, writes);
}
public static Payload readPayload(Reads read){
return Payload.read(read);
}
public static void writeMounts(Writes writes, WeaponMount[] mounts){
writes.b(mounts.length);
for(WeaponMount m : mounts){
writes.b((m.shoot ? 1 : 0) | (m.rotate ? 2 : 0));
writes.f(m.aimX);View on GitHub (pinned to f695ad7e60)
Solutions
- Match client and server versions.
- Server: catch ArcRuntimeException and kick the sender.
- Only emit value types 0/1/2 from menu builder code.
Defensive patterns
Strategy: try-catch
Try / catch
try { MenuResult r = TypeIO.readMenuResult(read); }
catch(ArcRuntimeException e){ Log.err("Bad menu result type", e); con.kick("Protocol mismatch."); } Prevention
- Keep client and server versions matched.
- Only emit value types 0 (float), 1 (boolean), 2 (string) from menu builders.
When it happens
Trigger: A menu value entry's type byte is not 0, 1, or 2.
Common situations: Version mismatch in the menu-result format; packet corruption; fuzzing.
Related errors
- UI result entry count exceeds max entries:
- Too many long strings in MenuResult, reduce your amount of e
- Unknown object type:
- Unknown plan config object type:
- Unknown save version: {}. Are you trying to load a save from
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/008fd20f0d84e14b.
Report an issue: GitHub.