Skip to content

fix(entities): send cat variant as cat_variant registry holder - #505

Open
michelmalle wants to merge 1 commit into
ViaVersionAddons:mainfrom
michelmalle:fix/cat-variant-entity-data
Open

michelmalle wants to merge 1 commit into
ViaVersionAddons:mainfrom
michelmalle:fix/cat-variant-entity-data

Conversation

@michelmalle

Copy link
Copy Markdown

Problem

Joining a Bedrock server with a Java 26.3 client via ViaProxy disconnects the client with "Network Protocol Error" as soon as a cat's entity data is synced:

IllegalStateException: Invalid entity data item type for field 20 on entity Cat:
old=Reference{minecraft:cat_variant / minecraft:black}, new=1 (Integer)

The CAT branch in EntityMetadataRewriter (marked TODO: Test when I can) wrote the Bedrock variant as a plain varIntType, while Java 26.3 expects catVariantType.

Fix

  • Use catVariantType, consistent with the existing wolf and frog handling.
  • Map Bedrock variant indices to Java cat_variant registry ids. The Bedrock order comes from controller.render.cat in Mojang/bedrock-samples, and the Java order from the bundled registries.nbt. Unknown variants fall back to TABBY with a warning.

Testing

Tested with ViaProxy 3.5.0-SNAPSHOT, a Java 26.3 client and a Bedrock 1.26.66 dedicated server with a black cat near spawn. Before the fix the client was disconnected every time within seconds of joining. After the fix it stays connected and the cat renders with the correct texture.

Java 26.3 expects the cat VARIANT entity data field to use the
cat_variant type. Sending a plain varint made the client disconnect
with a Network Protocol Error as soon as a cat's data was synced.
Also maps Bedrock cat variant indices to Java registry ids.
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.

1 participant