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

  1. Match client and server versions.
  2. Server: catch ArcRuntimeException and kick the sender.
  3. 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

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


AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14). Data as JSON: /api/errors/008fd20f0d84e14b. Report an issue: GitHub.