Skip to content

settings: send particleStatus to the server - #4049

Merged
rom1504 merged 1 commit into
masterfrom
fix/settings-particle-status-master
Sep 5, 2026
Merged

settings: send particleStatus to the server#4049
rom1504 merged 1 commit into
masterfrom
fix/settings-particle-status-master

Conversation

@u9g

@u9g u9g commented Sep 4, 2026

Copy link
Copy Markdown
Member

bot.settings.particleStatus has defaulted to 'all' since the field was added, but the settings packet mineflayer writes on login never included it. On 1.21.3+ (particleStatus is a mapper: all / decreased / minimal) the field was serialized from undefined. It only came out as 0 = all because protodef's compiled mapper falls an unmapped value through to the numeric type, where NaN writes as 0; the interpreted mapper throws on the same input.

ProtoDef-io/node-protodef#176 (merged, unreleased — latest protodef is 1.19.0 from 2025-04) makes the compiled mapper strict too, which turns this into a serialization error on every 1.21.3+ login. Send the field. The companion fix for node-minecraft-protocol's configuration-phase settings is PrismarineJS/node-minecraft-protocol#1519.

No version gate needed: protodef containers only write the fields the version defines, so the extra property is ignored pre-1.21.3. Confirmed in minecraft-data — packet_common_settings carries particleStatus from 1.21.3 on, and 1.21.1 / 1.16.5 / 1.8.8 have no such field.

This re-lands #4045, which was opened against the ci/duration-comment branch by mistake and merged there instead of into master, so the fix never reached master.

Tests: no test can fail without this change on the current protodef. Serializing the 1.21.4 settings packet both ways gives identical bytes (…000100 with particleStatus omitted and with 'all'), while 'minimal' writes 02 — the field is wired through correctly and is a no-op on the wire until protodef ships the strict mapper. Once it does, every existing 1.21.3+ external test exercises this (login would throw without it).

Ran locally: internal suite 688 passing; external suite 51 passing on each of 1.16.5, 1.20.4 and 1.21.4; lint clean.

@rom1504
rom1504 merged commit a5189e7 into master Sep 5, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants