mojira.dev
MC-306342

Stray adult cats play incorrect sounds

Stray adult cats meow as if they are tamed.

To reproduce:

  • Spawn a cat

    • It makes tamed cat sounds without being tamed

Expected result: cats should meow anxiously when being stray.

Actual result: cats meow confidently when stray.

Code Analysis

I did some debugging in a mod development environment and found that there is a mistake in the Codec of CatSoundVariant.CatSoundSet:

private static Codec<CatSoundSet> CODEC = 
	RecordCodecBuilder.create(
		i -> i.group(
			SoundEvent.CODEC
				.fieldOf("ambient_sound")
				.forGetter(CatSoundSet::ambientSound),
			
			// Here it goes wrong
			// It should use CatSoundSet::strayAmbientSound here
			SoundEvent.CODEC
				.fieldOf("stray_ambient_sound")
				.forGetter(CatSoundSet::ambientSound), // <--- HERE
			
			// other fields ...
		).apply(i, CatSoundSet::new)
	);

Common mistake I have often made in modding and sometimes pretty hard to trace.

Linked issues

Attachments

Comments 4

Here is a video of the bug

The second bullet point is already handled in MC-305579.

Alright, changed the report to only include the stray cat issue.

Update: did some debugging and added a code analysis.

Samu

(Unassigned)

1562220

Confirmed

Expansion A

Normal

Sound

26.1 Snapshot 7

26.1 Snapshot 8

Retrieved