mojira.dev
MC-61997

squids spawn in lava

if you put lava flowing down wards in an open space you can see squids spawning and falling
Please change the "How to reproduce" to this:


How to reproduce

  1. Create a "Redstone Ready" superflat world

  2. Go away from spawn (maybe about 1000 blocks)

  3. Set /gamerule doDaylightCycle false to prevent monsters from spawning

  4. Use the following commands

    /fill ~ ~-12 ~ ~50 ~-13 ~50 structure_void
    /fill ~ ~-1 ~ ~50 ~-11 ~50 lava
  5. Go below the lava
    → Squids will spawn and fall down


From MC-62856:

Steps to reproduce
1.Create superflat world
2. /fill ~50 ~-2 ~50 Lava
3.Go down 3 blocks
4./fill ~50 ~-2 ~50 Piston_Extension
5. Watch
Mod edit


Code analysis by @unknown in this comment

Linked issues

Attachments

Comments 21

Can confirm this. They are spawning inside of lava.

Confirmed as of 1.8.1 full release.

11 more comments

Please change the "How to reproduce" to this:

How to reproduce

  1. Create a "Redstone Ready" superflat world

  2. Go away from spawn (maybe about 1000 blocks)

  3. Set /gamerule doDaylightCycle false to prevent monsters from spawning

  4. Use the following commands

    /fill ~ ~-12 ~ ~50 ~-13 ~50 structure_void
    /fill ~ ~-1 ~ ~50 ~-11 ~50 lava
  5. Go below the lava
    → Squids will spawn and fall down

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

The reason for this is very likely that the method net.minecraft.world.WorldEntitySpawner.canCreatureTypeSpawnAtLocation(SpawnPlacementType, World, BlockPos) tests in case the SpawnPlacementType is IN_WATER (used by Guardians and Squids) only if the blocks are liquids. Instead it should test if the material of the block is water.

public static boolean canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType spawnPlacementTypeIn, World worldIn, BlockPos pos)
{
    if (!worldIn.getWorldBorder().contains(pos))
    {
        return false;
    }
    else
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (spawnPlacementTypeIn == EntityLiving.SpawnPlacementType.IN_WATER)
        {
            // Replaced this
            // Imported "net.minecraft.block.material.Material"
            //return iblockstate.getMaterial().isLiquid() && worldIn.getBlockState(pos.down()).getMaterial().isLiquid() && !worldIn.getBlockState(pos.up()).isNormalCube();
            return iblockstate.getMaterial() == Material.WATER && worldIn.getBlockState(pos.down()).getMaterial() == Material.WATER && !worldIn.getBlockState(pos.up()).isNormalCube();
        }
        else
        {
            BlockPos blockpos = pos.down();

            if (!worldIn.getBlockState(blockpos).isFullyOpaque())
            {
                return false;
            }
            else
            {
                Block block = worldIn.getBlockState(blockpos).getBlock();
                boolean flag = block != Blocks.BEDROCK && block != Blocks.BARRIER;
                return flag && isValidEmptySpawnBlock(iblockstate) && isValidEmptySpawnBlock(worldIn.getBlockState(pos.up()));
            }
        }
    }
}

three cheers for mojang! they fixed it

Juan Pablo Molina

Agnes Larsson

Confirmed

Minecraft 14w28b, Minecraft 14w31a, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, ..., Minecraft 1.10 Pre-Release 1, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w35a

Minecraft 1.8.7, Minecraft 16w38a

Retrieved