mojira.dev
MC-113935

onInitialSpawn modifies world even if mob was not spawned

The bug

The method net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) (respectively methods overriding it) modify the world even if the mob the method was called for was not spawned.

How to reproduce

This can currently be seen with MC-103516. The additional mob is spawned but the mob the method was called for is not spawned.

Affected classes

Based on 1.11.2 decompiled using MCP 9.35 rc1

Class

Description

EntitySpider

Spawns skeleton 1

EntityZombie

Spawns chicken or sets IsChickenJockey of existing chicken to true 1

EntityOcelot

Spawns other ocelots

1 Currently blocked by MC-111747 which describes that position and bounding box are not instantly updated when an entity starts riding another entity

Linked issues

Comments 2

Is this still the case now that MC-103516 is fixed?

It appears in all cases (?) this method is called when the entity will also be spawned in the world. So while this problem still exists in theory, it can currently not happen.

marcono1234

(Unassigned)

Confirmed

(Unassigned)

chicken, chicken-jockey, mob, ocelot, spawn, spider, spider-jockey, zombie

Minecraft 1.11.2, Minecraft 17w06a

Retrieved