The bug
According to MC-176468, striders should not spawn with saddles. However, in peaceful mode, striders can spawn with saddles, because it spawns as a jockey and the zombified piglin instantly despawns.
To reproduce
Create a Peaceful creative world.
Go into the nether.
Roam around and load new chunks, periodically executing the command:
/tp @e[type=strider,nbt={Saddle:1b}] @p
❌ It will eventually be successful, indicating that striders with saddles spawn in peaceful mode.
Code analysis (tentative)
I am not sure if this is actually the cause of the issue, but it seems plausible. This is using Mojang mappings (21w11a). In Strider#finalizeSpawn(...)
, this is the code that spawns zombified piglin strider jockeys:
...
if (this.random.nextInt(30) == 0) {
Mob $$5 = EntityType.ZOMBIFIED_PIGLIN.create($$0.getLevel());
$$3 = this.spawnJockey($$0, $$1, $$5, new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(this.random), false));
$$5.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.WARPED_FUNGUS_ON_A_STICK));
this.equipSaddle((SoundSource)null);
}
...
return super.finalizeSpawn($$0, $$1, $$2, $$3, $$4);
There is no check done to verify the level difficulty, so the jockeys spawn in Peaceful mode only to despawn almost instantly, leaving the saddle behind.
Related MC-183012