The Villainous Horde Manager is an API built upon the code from Cold Snap Horde and its horde system. It aims to maintain a consistent number of enemies until enough have been defeated to conclude the event. Unlike the initial version of Cold Snap Horde, the code for this mod is designed for reusability and is capable of spawning vanilla or modded mobs and directing them towards the target player, similar to how snowmen behave during the horde event.
You can now make your own hordes via JSON magic
Check the github page for detailed information on creating hordes using JSON.
If you are a mod developer and want more control over a custom horde
Refer to the github page, where each module includes an example of how to instantiate hordes and ensure their proper functioning on a given platform (quilt being the same as fabric, in this case).
Interested? Here's some more!
If you are still reading this, you are likely a developer interested in exploring the code for this event. I welcome helpful contributions and am willing to provide assistance within reason to help you set up hordes.
Additional details about horde requirements:
Entities added to the horde must extend the PathfinderMob class. Alternatively, you can utilize the enum system to bypass this, although this is not recommended.
Larger entities are more challenging to spawn due to the system's attempt to avoid situations where mobs would suffocate. It is advisable to minimize the presence of larger mobs or keep their spawn weights low.
The API will scan the environment around a potential spawn point for any solid blocks. The size of the scan depends on the size of the mob, with larger mobs consuming more server resources.
The system endeavors to spawn mobs at a relatively close Y-level to the player, prioritizing locations above the player over those below.
If the system is unable to find a nearby Y-level, it will settle for any available Y-level.
If a player prevents entities from spawning, the horde will cease in order to avoid consuming additional system resources.
Server Hosting
I've partnered with BisectHosting! If you need a quality server, click the picture below and use code "cartoonish" for 25% off your first month!
* /startJsonHorde now can accept a player as an anchorTarget parameter.
* If a non-player is calling /startJsonHorde, anchorTarget is a **required** parameter
* /startJsonHorde now can accept a player as an anchorTarget parameter.
* If a non-player is calling /startJsonHorde, anchorTarget is a **required** parameter
* /startJsonHorde now can accept a player as an anchorTarget parameter.
* If a non-player is calling /startJsonHorde, anchorTarget is a **required** parameter
* Decreases odds of entities spawning in walls
* Utilizes vanilla game techniques to determine if mob spawns are valid, which may increase reliability of hordes (decreasing how much they despawn due to missing spawn points)
* Small optimizations
* More gracefully handles the error when a JSON horde has an entity that isn't a pathfindingmob (Kills the horde and throws an error in the logs, instead of crashing)
* Mobs in hordes will now spawn as expected. (Skeletons have their bows, vindicators have their axes, etc.)
* Json Hordes can now specify how many retries for finding spawn points they want to do.
* Refactored how some of the horde types are handled
* Fixed a crash that can happen when a spawn was invalid.
* Json handling is supported for custom hordes! You can now have you own (basic) horde without needing to make your own mod.
* For information on how to make your own hordes, see the github page.
* Port to 1.19.4
* Splits Hordes into two types. EntityTypeHorde, which is the equivalent to 0.3's horde class, and EntityEnumHorde.
* EntityEnumHorde is meant to make a system like ColdSnapHordes better supported and less janky, where Cold Snap Horde has to rewrite large portions of the code base for custom spawn rules. Using the enums, the consuming mod is expected to provide their own spawn method and is given the method to do so in.
* EnumHordeData can support any enum that extends RuleEnumInterface.