Hello,
I'm trying to achieve a couple of different things in my mod that's going to be updated once 1.16 fully releases (and hopefully forge too) and I have a couple of stumbling blocks that I don't seem to understand about certain aspects about modding. I'm quite new at it and this is the very first mod that I've ever developed. It's been a month since I've developed a mod with a friend and for weeks and I kept stumbling about spawns... in general actually. For biomes, it seems pretty straightforward: using registryWorldSpawn() method to spawn the modded mobs into the world in that biome.
I have 3 new mobs in this mod: the Skeletal Magi. The Skeletal Magi has three different versions much like the regular skeletons: Skeleton Mage, Stray Mage and Wither Mage. The difference between a Skeleton and a Skeleton Mage is that a Skeleton Mage shoots a magical projectile that causes aliments to the target entities they hit rather than shooting with an arrow (So a Skeleton Mage shoots a fireball much like Blaze but not as lethal as them). They also do not burn in sunlight as they are exposed to magic much like the Witches and they are pretty.. uhh... "Uncommonly common". The Skeletal Magi as classes of entities are complete (fully textured, successfully rendered, slight changes of AI here and there) but I have trouble with other interactions.
I wish to achieve the following goals and know more from posting here:
As the title suggests, one of the biggest stumbling block I have is spawning in a specific generated structure. While this is not really a problem for a customized generated structure, I have trouble with modifying the vanilla generated structure. I wish to update the Nether Fortress' list of mobs that spawn there. In FortressStructure class in the vanilla minecraft, there is a List of Biome.spawnListEntry that contains a list of mobs that spawn in that generated structure: Blazes, Zombie Pigmen (Or maybe Piglins in the future), Wither Skeletons, Skeletons and Magma Cubes. I wish to update this list by adding Skeleton Mages and Wither Mages as well. In this class: the field variable is private static final which means I can't even access it or even change the list variable (The objects are mutable but I don't see a reason why I would do so and this variable should be untouched anyway) and there is a List<Biome.SpawnListEntry> method called getSpawnList() that is public and is able to be overwritten only to do this in a deferred registry and my mod has trouble loading the said feature: only to update the spawn list! A shed of light that updates the SpawnList as well as usage of deferred registries of such feature would be much appreciated for this one because this has been bothering me for weeks. Do I need to use deferred registries to update the list of mobs? Have I yet to understand how they work? They seem to work for sounds, items and entities... :L
I also wish to update some things about other entities that is other than the Skeletal Magi: if a Skeleton gets hit by lightning, it becomes a Skeleton Mage. Clearly, this is not something that can be done through the mage classes themselves and this is just updating the normal skeleton entity from vanilla. While this is just one of the examples, I wish to know how to update certain attributes of normal minecraft entities from this mod. I want to achieve something like: updating Vexes and Ghasts into undead attributes; if a fox gets hit by a lightning, it becomes a kumiho demon; etc. How do I achieve this? Do I just make a new class that extends the original class from the vanilla minecraft.
So that's pretty much I would like to know. There are more that I would like to know and would humbly like to ask for assistance such as enchantments, ambient boss musics, etc. In general, I would like to know how to replace or update entities spawned by vanilla minecraft such as the villagers and TangoTek's Tektopia mod. Any replies and enlightenment would be most interested.
TL;DR Look at the bolded words, but if you would like to know details, please read the whole post.