Posted March 12, 20214 yr I'm currently trying to set a custom mob to spawn in a specific biome, and I've looked at a couple of reference mods to see if I've been missing anything, but my mob just somehow cannot spawn. @SubscribeEvent(priority = EventPriority.HIGH) public static void addBiomeSpawn(BiomeLoadingEvent event) { Biome biome = ForgeRegistries.BIOMES.getValue(event.getName()); System.out.println(biome.toString()); if (biome.toString().equals("minecraft:plains")) { System.out.println("Its been Added!"); event.getSpawns().getSpawner(EntityClassification.CREATURE).add(new MobSpawnInfo.Spawners(BestiaryRegistry.SEAL, 100, 1, 3)); } } as far as I'm concerned this is the only thing that has to be done, and it appears that my mob has been added to the spawn list, but it just refuses to appear. I feel like I'm missing something really stupid here but I can't figure it out. http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
March 12, 20214 yr So, does this line actually get executed? Does the message appear in the console? System.out.println("Its been Added!"); Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
March 13, 20214 yr Author Yes. I've also discovered if I remove the if statement and add the spawner to every BiomeLoadingEvent my mob DOES spawn in every biome, which seems odd to me. Is there a specific number of biomes I must add a mob to, or an overworld specific event I need to also account for? http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
March 13, 20214 yr Author I've been doing some research, and it appears that my spawn function for my mob is set to spawn only on ice, but under the Blocks class SPECIFICALLY Ice is set to only allow Polar Bears to spawn, so the spawn algorithm returns false for ice whenever it checks if the block is spawnable. I went ahead and tried to override the Minecraft version of Ice by copying the code and adding my own mob: public static final RegistryObject<Block> ICE = VANILLA_BLOCKS.register("ice", () -> new IceBlock(AbstractBlock.Properties.create(Material.ICE) .slipperiness(0.98F) .tickRandomly() .hardnessAndResistance(0.5F) .sound(SoundType.GLASS) .notSolid() .setAllowsSpawn((state, reader, pos, entity) -> { return entity == EntityType.POLAR_BEAR || entity == BestiaryRegistry.SEAL; })) ); And my mob now spawns properly, except now Ice has disappeared from the creative menu and cannot be picked with middle mouse button. Is there anyway I can fix this, or even better, override a Vanilla blocks property without having to recreate the block? http://driesgames.game-server.cc//banner.png[/img] Java, Hosting Servers and Videos...
March 13, 20214 yr Well, this is just vanilla hardcoding things, quite typical actually..so, i see your mob is a seal, you can try to make it spawn on other type of ices (blue and packed), on snow, grass and water. Unfortunately you cannot make it spawn on ice easily, unless using some weird workaround Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.