mojira.dev
MC-259321

Spawner counts related entities against MaxNearbyEntities

This bug was first reported in MC-26274. Since it has been closed for many years (erroneously), I am reopening under a new issue.

Before spawning, spawners check if there are more than MaxNearbyEntities entities of the same type as the spawner. If so, it skips spawning. However, this miscounts entities that are similar. This could be WAI, if not for the fact that it's not symmetric:

Cave spiders count toward a Spider spawner's mob cap, but spiders don't count toward a cave spider spawner.

Magma cubes block slime spawners, but not vice versa.

Pigmen, husks, and drowned block zombie spawners, but not vice versa.

 

To reproduce, spawn many pigmen. Place a zombie spawner nearby. No zombies will spawn.

Linked issues

Comments 1

It appears the check is a "is TYPE" check, where it will succeed subclasses for the parent class (eg cave spiders are a child class of the spider class). A type equality check should instead be in place to fix this.

tchatow

etanaratsastaja

Confirmed

Platform

Low

Mob spawning

1.19.3, 1.20 Pre-release 7, 23w44a

23w46a

Retrieved