In Control!

In Control!

74M Downloads

[1.18.2] InControl does not fire LivingSpawnEvent.SpecialSpawn for entities it spawns

Shadows-of-Fire opened this issue ยท 2 comments

commented

Per the title, InC is not firing the SpecialSpawn event, so other mods cannot react to InC-spawned mobs. Offending code is here https://github.com/McJtyMods/InControl/blob/1.18/src/main/java/mcjty/incontrol/spawner/SpawnerSystem.java#L170

The relevant vanilla code is (from NaturalSpawner L183-190 with some parts omitted)

int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(mob, pLevel, d0, i, d1, null, MobSpawnType.NATURAL);
if (canSpawn != -1 && (canSpawn == 1 || isValidPositionForMob(pLevel, mob, d2))) {
if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(mob, (LevelAccessor) pLevel, (float)d0, (float)i, (float)d1, null, MobSpawnType.NATURAL))
spawngroupdata = mob.finalizeSpawn(pLevel, pLevel.getCurrentDifficultyAt(mob.blockPosition()), MobSpawnType.NATURAL, spawngroupdata, (CompoundTag)null);
pLevel.addFreshEntityWithPassengers(mob);
commented
commented

Should be fixed now