Alex's Mobs

Alex's Mobs

96M Downloads

1.20.1 (and other versions possibly) Structure Spawn area for Skelewags too small for regulated spawning

Shibva opened this issue ยท 1 comments

commented

I was annoyed by this bug so much that I attempted to make a script for it to add their spawns back, but while toying around with my pack (after doing what was recommended and regen the configs based on past reports and related issues) discovered that Structure Gel API has a nifty feature that allows me to visualise the borders of a structure (jigsaw segments, potential generation, structure boundaries, etc) and found the potential reason why this is happening.

Its because the spawn area for the Skelewags (being as large as they are) is too small for them to all the spawn checks in most circumstances (as there may be a RARE chance for one to spawn)

For a visual reference, here is a pillager outpost; the green represents the generated segments of the sctucture, blue representing part of the sctucture that could have generated (I think), and white being the area of the sctucture. I chose this because its a structure where pillagers will spawn within the white box.

Image

This is the structure of a shipwreck
Image

As you can see, the green and white bounds blend in, indicating they are the same size and because the sctrucute itself has a small area mostly occupied by blocks and how LARGE a Skelewag is, any attempt to spawn one in by the game naturally will fail primarily because some part of it would spawn within a block (which is also NOT water).

I have yet to test this in a pure instance to determine if another mod is possibly reducing the size of the structure for some reason or another.

(Note to those who are seeking answers: The Restricive Spawn setting for the Skelewag under Unique Spawning can be disabled in the config; however, it will not do anything UNTIL you restart the game for it to take effect (there really should be a message or (Restart Required) in the option description :/ )

commented

First of all, I can confirm this happens on the latest version of the mod in a clean dev environment. I tested this only in 1.20.1.

I was so annoyed by this, I wrote a mod that aims to fix this by increasing the spawn area around structures. If anyone stumbles upon this (or the repo is revived some day), please have a look at this: https://github.com/kvnmtz/structure-spawn-area-fix

My approach is to add a mixin to NaturalSpawner$mobsAt, check for structures (can be specified in the config) nearby and override the possible mob spawns to those of the structure on a match.

Another way without mixins could be to make them spawn unrestricted regardless of the config, but add such a structure check when the config option to restrict them is enabled in the EntitySkelewag$canSkelewagSpawn method, but I haven't looked into such an approach very deeply.