FlashHUN Posted March 24, 2019 Posted March 24, 2019 (edited) How can I make an entity naturally spawn in multiple biome types? Like, for example, how could I make it spawn in plains biomes, forest biomes and desert biomes at the same time? @SubscribeEvent public void onEntityRegistry(RegistryEvent.Register<EntityEntry> event) { event.getRegistry().register(EntityEntryBuilder.create().entity(EntityShinobi.class).id (new ResourceLocation(References.mod_id, "mobs"), References.ENTITY_SHINOBI).name("RogueShinobi").tracker (50, 1, true).spawn(EnumCreatureType.CREATURE, 45, 1, 6, BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS)).egg (16770207, 000000).build()); } Edited March 24, 2019 by FlashHUN marked as solved Quote
FlashHUN Posted March 24, 2019 Author Posted March 24, 2019 1 hour ago, diesieben07 said: The spawn method asks for either an array of biomes or an Iterable of biomes. Just create a List and put all the biomes you want in there. List<Set<Biome>> biomes = new ArrayList<Set<Biome>>(); biomes.add(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS)); biomes.add(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST)); biomes.add(BiomeDictionary.getBiomes(BiomeDictionary.Type.SANDY)); event.getRegistry().register(EntityEntryBuilder.create().entity(EntityShinobi.class).id (new ResourceLocation(References.mod_id, "mobs"), References.ENTITY_SHINOBI).name("RogueShinobi").tracker (50, 1, true).spawn(EnumCreatureType.CREATURE, 45, 1, 6, biomes).egg (16770207, 000000).build()); Alright, but how should I make that list? This gives me an error in the spawn method and I have no idea how to make that list Quote
Recommended Posts
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.