Pumpkin-MC/Pumpkin · error
duplicate player input flag
Error message
duplicate player input flag {flag} What it means
This error is thrown while decoding the Bedrock PlayerAuthInput packet when the client's InputData bitfield repeats a PlayerInput flag that was already set in the same packet. The server rejects the packet as invalid data rather than tolerating redundant bits, because duplicated flags indicate a malformed or malicious packet.
Solutions
- Update the client to a version matching the server's supported Bedrock protocol
- Inspect the client's PlayerAuthInput serialization for duplicate flag emission
- If you control middleware/proxies, re-encode InputData without duplicate flag bits
- Kick the offending client; this is by-design rejection of malformed input
Example fix
// before (server-side strictness is correct; fix the sender)
input_data.set(flag as usize, true); // called twice for same flag
// after (sender must emit each flag once)
if !input_data.get(flag as usize) { input_data.set(flag as usize, true); } Defensive patterns
Strategy: validation
Validate before calling
// Cannot pre-validate raw wire input; on the server, ensure flags are set once:
if input_data.get(flag as usize) { /* already set -> skip or reject */ } Try / catch
match decode_player_auth_input(buf) {
Err(e) if e.kind() == std::io::ErrorKind::InvalidData => { disconnect(client, e); }
Err(e) => propagate(e),
Ok(p) => handle(p),
} Prevention
- Keep client and server Bedrock protocol versions in sync
- Never hand-craft PlayerAuthInput packets; use the protocol crate's encoder
- Log and drop invalid packets instead of panicking
- Fuzz-test the decoder against malformed bitfields
When it happens
Trigger: A client sends PlayerAuthInput whose InputData VarULong has a flag bit encoded more than once in the flag-listing sub-protocol (input_data.get(flag as usize) is already true when the flag is decoded).
Common situations: Bugged or modded Bedrock clients, custom/older protocol implementations, or crafted packets from untrusted clients probing the server.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- item string array length out of bounds
- miss_count exceeds limit
- hit_count exceeds limit
- length exceeds
- missing inventory transaction type
AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09).
Data as JSON: /api/errors/000745402f54d0cc.
Report an issue: GitHub.
Appendix: source
Thrown at crates/pumpkin-protocol/src/bedrock/server/player_auth_input.rs:64
let mut input_data = Bitset::<66>::default();
if bool::read(reader)? {
let count = VarUInt::read(reader)?.0;
if count > 66 {
return Err(Error::new(
ErrorKind::InvalidData,
format!("too many player input flags: {count}"),
));
}
for _ in 0..count {
let flag = VarInt::read(reader)?.0;
if !(0..66).contains(&flag) {
return Err(Error::new(
ErrorKind::InvalidData,
format!("invalid player input flag {flag}"),
));
}
if input_data.get(flag as usize) {
return Err(Error::new(
ErrorKind::InvalidData,
format!("duplicate player input flag {flag}"),
));
}
input_data.set(flag as usize, true);
}
}
let input_mode = VarUInt::read(reader)?;
let play_mode = VarUInt::read(reader)?;
let interaction_model = VarInt::read(reader)?;
let interact_pitch = f32::read(reader)?;
let interact_yaw = f32::read(reader)?;
let tick = VarULong::read(reader)?;
let delta = Vector3::<f32>::read(reader)?;
// 1. Perform Item Interaction
let item_interaction = if bool::read(reader)? && bool::read(reader)? {
Some(PlayerInventoryAction::read(reader)?)View on GitHub (pinned to 8d4639e25a)