mojira.dev
MC-232869

Adult striders can spawn with saddles in peaceful mode

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

  1. Create a Peaceful creative world.

  2. Go into the nether.

  3. Roam around and load new chunks, periodically executing the command:

    /tp @e[type=strider,nbt={Saddle:1b}] @p
  4. ❌ 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 issues

Attachments

Comments

migrated
[media][media][media]
migrated

Related MC-183012

Avoma

Can confirm.

Avoma

Can confirm in 1.19.1.

ampolive

(Unassigned)

Confirmed

Mob spawning

mob-spawning, peaceful, strider

1.17.1, 21w38a, 21w40a, 21w41a, 21w42a, ..., 1.19.3, 1.20 Pre-release 4, 1.20.1, 1.20.2, 1.20.4

Retrieved