Posted October 9, 20213 yr I'm using the biomeLoad event to spawn my duck entity in, but when returning to a biome or standing still in it, the ducks will keep on spawning at the same location on my modded server. How do I prevent this? I only want them to spawn once, at the same rate as chickens, near beaches or rivers. GitRepo: https://github.com/Leronus/mOres Image for reference: https://imgshare.io/image/2021-10-09-182453.pFfbGp Class location: mOres/src/main/java/mod/mores/events/EntityEvent.java Edited October 9, 20213 yr by Leronus Further explanation
October 17, 20213 yr Author On 10/9/2021 at 8:35 PM, Luis_ST said: try to reduce the spawn weight, set it for testing to 1 Locally that seems to have fixed it, but on my modded server they are still spawning A LOT. GitRepo: https://github.com/Leronus/mOres Img: https://imgshare.io/image/2021-10-17-110104.pgUz1y
October 17, 20213 yr I tried to reproduce your problem, but i can't. The ducks are very rare in Beach and River Biomes and when they spawn there are 2-5 Ducks the code works how it should
October 17, 20213 yr Author 34 minutes ago, Luis_ST said: I tried to reproduce your problem, but i can't. The ducks are very rare in Beach and River Biomes and when they spawn there are 2-5 Ducks the code works how it should It works in singleplayer yes, but not on a server. That's when they keep spawning over and over.
October 17, 20213 yr 1 hour ago, Leronus said: It works in singleplayer yes, but not on a server. That's when they keep spawning over and over. for me it works on server and on client, again the code works how it should with this code: Spoiler @SubscribeEvent public static void onBiomeLoad(final BiomeLoadingEvent event){ if (event.getName() == null){ return; } if (Config.duckSpawning.get()) { MobSpawnInfoBuilder spawns = event.getSpawns(); if (event.getCategory().equals(Biome.Category.BEACH) || event.getCategory().equals(Biome.Category.RIVER)) { spawns.addSpawn(EntityClassification.WATER_CREATURE, new MobSpawnInfo.Spawners(EntityTypeInit.DUCK.get(), 5, 2, 5)); } } } client: https://ibb.co/Pz4xgjS server: https://ibb.co/XtLRTjN
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.