Jump to content

Recommended Posts

Posted (edited)
for (Biome biome : ForgeRegistries.BIOMES) {
  
  biome.getSpawns(EntityClassification.CREATURE).clear();
  biome.getSpawns(EntityClassification.CREATURE).add(new Biome.SpawnListEntry(EntityType.PIG, 1, 3, 5)); 
}

 

I can clear all existing spawns from a biome using the clear method, which allows me to add a spawn exactly how I want, but then everything is gone. There are remove methods but they don't seem to be able to remove specific entities. Anyone know how to do this?

Edited by MineModder2000
Posted
23 minutes ago, diesieben07 said:

Biome#getSpawns returns a List<Biome.SpawnListEntry>.

Removing "hello" from List(1, 2, 3) is still List(1, 2, 3).

Yeah I had figured that out. I also just figured out how to remove the specific entity from the index ?

 

Posted
4 hours ago, diesieben07 said:

Indices? This is 2020. Use removeIf with a Predicate to tell the list which elements you want removed.

I'm old school, but I guess I can learn new tricks ?

 

PS : I just learned how to do it. 

  • 3 weeks later...
Posted (edited)
On 1/30/2020 at 1:32 AM, MineModder2000 said:

I'm old school, but I guess I can learn new tricks ?

 

PS : I just learned how to do it. 

I'm very new to modding and I can't seem to figure out how to do it... :(

Maybe I'm being really stupid, but how did you do it?

Edited by Xrated_junior
Posted
13 hours ago, MineModder2000 said:
Iterator<SpawnListEntry> biomeSpawns = biome.getSpawns(EntityClassification.CREATURE).iterator();
    			
while(biomeSpawns.hasNext()) {
	SpawnListEntry entry = biomeSpawns.next();
	if (entry.entityType == EntityType.PIG)
	{
		biomeSpawns.remove();
	}
}

 

Thank you! I will definitely look at that.  I did get it to work eventually. Don't know if it looks bad though... :) 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.