-
Bug
-
Resolution: Unresolved
-
None
-
1.17.1, 21w38a, 21w40a, 21w41a, 21w42a, 21w43a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 2, 1.18 Pre-release 5, 1.18 Pre-release 6, 1.18 Release Candidate 1, 1.18, 1.18.1 Release Candidate 1, 1.18.1, 22w03a, 22w05a, 22w07a, 22w11a, 22w15a, 22w18a, 1.19, 1.19.1 Pre-release 5, 1.19.1, 1.19.2, 1.19.3, 1.20 Pre-release 4, 1.20.1, 1.20.2, 1.20.4
-
Confirmed
-
Mob spawning
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.