Skip to content

fix particle packets on 1.21.3-1.21.11 - #1179

Open
MayorLeon20 wants to merge 4 commits into
PrismarineJS:masterfrom
MayorLeon20:contribute
Open

fix particle packets on 1.21.3-1.21.11#1179
MayorLeon20 wants to merge 4 commits into
PrismarineJS:masterfrom
MayorLeon20:contribute

Conversation

@MayorLeon20

@MayorLeon20 MayorLeon20 commented May 6, 2026

Copy link
Copy Markdown

updated trail, dust, dust_color_transition particles according to https://minecraft.wiki/w/Java_Edition_protocol/Particles + https://minecraft.wiki/w/Particles#Java_Edition

@extremeheat

Copy link
Copy Markdown
Member

Do you have a link to source code for these changes?

@MayorLeon20

Copy link
Copy Markdown
Author

Do you have a link to source code for these changes?

no, only the links I sent earlier

@MayorLeon20

Copy link
Copy Markdown
Author

@extremeheat

@MayorLeon20 MayorLeon20 closed this May 9, 2026
@MayorLeon20 MayorLeon20 reopened this May 9, 2026
@MayorLeon20

Copy link
Copy Markdown
Author

by accident

@MayorLeon20

Copy link
Copy Markdown
Author

extremeheat/extracted_minecraft_data@5039f20
This commit in client\net\minecraft\core\particles\DustParticleOptions.java changes the argument type from vec3f to a regular integer. => The color is specified with one parameter instead of three. + The getColor function now converts from RGB24 to vector3f.

Similarly for client\net\minecraft\core\particles\DustColorTransitionOptions.java

extremeheat/extracted_minecraft_data@caf65bf
This commit changes the particle trail options file from client\net\minecraft\core\particles\TargetColorParticleOption.java to client\net\minecraft\core\particles\TrailParticleOption.java
You can see the new duration parameter.

@MayorLeon20

Copy link
Copy Markdown
Author

@extremeheat

This comment was marked as outdated.

@extremeheat

Copy link
Copy Markdown
Member

Instead of posting large diffs, pointing directly to the source code file for the specific version is much more helpful. In general wiki is not a reliable source for protocol changes

@extremeheat

Copy link
Copy Markdown
Member

Claude reports ok


Here's my complete review of the patch against vanilla source code:

Verdict: ✅ Patch is correct

I verified all three particle types changed in the patch against the stream codecs in the vanilla source.


1. dust particle — correct

Vanilla (DustParticleOptions.STREAM_CODEC, both 1.21.2 and 1.21.11):

StreamCodec.composite(ByteBufCodecs.INT, color, ByteBufCodecs.FLOAT, scale, ...)

The old data (red: f32, green: f32, blue: f32, scale: f32) was wrong. The actual wire format is a packed RGB integer followed by a float scale.
color: i32, scale: f32


2. dust_color_transition particle — correct

Vanilla (DustColorTransitionOptions.STREAM_CODEC, both 1.21.2 and 1.21.11):

StreamCodec.composite(ByteBufCodecs.INT, fromColor, ByteBufCodecs.INT, toColor, ByteBufCodecs.FLOAT, scale, ...)

The old data had 7 fields (fromRed, fromGreen, fromBlue, scale, toRed, toGreen, toBlue). The actual wire format is two packed RGB ints + scale float — scale was also in the wrong position in the middle.
fromColor: i32, toColor: i32, scale: f32


3. trail particle — correct (the color: u8 change is for trail, not entity_effect)

  • 1.21.3: color: u8 → color: i32 (no duration). Matches 1.21.2's TargetColorParticleOption.STREAM_CODEC: Vec3 + ByteBufCodecs.INT — no duration field ✓
  • 1.21.4–1.21.11: color: u8 → color: i32 + adds duration: varint. Matches 1.21.11's TrailParticleOption.STREAM_CODEC: Vec3 + ByteBufCodecs.INT + ByteBufCodecs.VAR_INT

entity_effect — not changed by this patch

In all affected versions, entity_effect is correctly represented as an inline "i32" (not a named container field), matching ColorParticleOption.streamCodec which is just ByteBufCodecs.INT. The patch doesn't touch this.


  • 1.21.3: TargetColorParticleOption.STREAM_CODEC = Vec3 + INT(color) — no duration. Patch correctly adds only color: i32 for this version. ✓
  • 1.21.4: Renamed to TrailParticleOption, STREAM_CODEC = Vec3 + INT(color) + VAR_INT(duration)duration was introduced here. Patch correctly adds color: i32 + duration: varint starting from 1.21.4. ✓

The patch is fully correct across all versions 1.21.3–1.21.11.

@extremeheat

Copy link
Copy Markdown
Member

Please revert that change from copilot. It was incorrect and unsourced

@MayorLeon20

Copy link
Copy Markdown
Author

👍

@MayorLeon20

Copy link
Copy Markdown
Author

i dont understand minecraft sources
first pr sry

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.

3 participants