mojira.dev
MCPE-153897

Buttons no longer block spider spawns

I update my world to 1.19.0.20 and I noticed in Creeper Farm that spiders can spawn on buttons, maybe if there is no trapdor around, maybe all mobs can spawn on buttons.

Linked issues

Attachments

Comments

migrated

Can confirm on 1.19.0.21 Preview on Windows 11, although the issue is slightly different than described.
The spiders don't directly spawn on the buttons, since the spawn attempt will happen on the block next to the button. Therefore, a more accurate description would be the following:
"Buttons don't block spider spawns".

Steps to reproduce:

  1. Create a large platform with one button every second block. I have attached a world download of such a setup:

[media]
  1. Set the time to night (artificial darkness using blocks will also work).

  2. Turn on mob spawning & distance yourself to the proper range (24 blocks away from the platform).

Expected results:

Only mobs which do not intersect with the buttons spawn (usually all hostile mobs except spiders).

Actual results:

Mobs including spiders will spawn.

migrated

I would like to point out that this has been a well established mechanic for several years in the Minecraft community. Countless mob farms make use of this interaction to block spider spawns. Removing such an established mechanic does nothing but limit creativity and hurt existing mob farms that heavily rely on this behavior to work the way they do. 

Please consider a revert. Nothing about it breaks the game balance, nor does it have any negative side effects for other aspects of regular gameplay. The only consequence this change will have is hurting players.

racartwright

I too can confirm this bug on Windows 10. I tested a world that only contains a creeper farm, and spiders are spawning in the farm.

I suspect that the way the collision box is calculated for buttons has changed in 1.19 preview.

GoldenHelmet

Buttons have long been the only block in Bedrock Edition that can block spiders from spawning without obstructing other mobs from walking or being pushed. Blocks like fences, walls, and iron bars can block spider spawns but they obstruct movement. For this reason buttons are used in all top-tier creeper farm designs.

Fences would be a terrible replacement not only b/c they obstruct movement, but even more because mobs literally get stuck on them and cannot move: MCPE-46805.

In Java Edition many creeper farms use carpet to block spiders, but if you replace buttons with carpet in Bedrock Edition then nothing will spawn at all due to MCPE-99315.

migrated

I have to agree with the other comments. A button is a redstone component.  If consistency and game mechanics matter, you cannot allow spiders to spawn on buttons. 

racartwright

I figured out what changed in 1.18.30 that broke creeper farms.

Code Analysis

When spiders (and most mobs) spawn, the game will cancel the spawning attempt if the mob collides with any block that has an AABB (axis-aligned bounding box). The function used for this is the virtual function BlockLegacy::getAABB() or its overrides. A refactoring occurred between 1.17 and 1.18 that added a boolean parameter to this function. I'll call it param_5. When param_5 is set to false, many blocks return an empty AABB. This is likely used to distinguish different types of AABBs, such as collision boxes or hit boxes. Notably param_5 is set to false when the game checks if a mob collides with any block.

In 1.18.30, ButtonBlock::getAABB() has been added to the game. (Buttons used BlockLegacy::getAABB() in earlier versions.) The dev who wrote this function included logic that returns an empty AABB if param_5 is false. This returns an empty bounding box during mob spawning, causing buttons to stop blocking spider spawns. This isn't a minor inconvenience. Even a small creeper farm can have thousands of buttons that would need to be replaced by an alternative block (if one even exists).

The Fix

Remove the logic in ButtonBlock::getAABB() that returns an empty bounding box if param_5 is false. ButtonBlock::getAABB() should always return an accurate bounding box regardless of the value of param_5.  Given how quickly changes to pathfinding on coral fans was fixed, I hope that this bug can be quickly fixed as well.

migrated

I can confirm this for the version 1.18.30 on my realm in bedrock minecraft. The spiders cant be avoided with buttons i tried even leavs instead of a full block with button or fence nothing works to prevent them. Creeper farms are momentarly impossible to run

migrated

(Unassigned)

764199

Confirmed

Multiple

1.19.0.26 Beta, 1.19.0.24 Beta, 1.19.0.20 Beta, 1.18.30

1.18.31

Retrieved