Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted
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

  • Author
2 minutes ago, diesieben07 said:

Why not? Show what you tried.

 

			biome.getSpawns(EntityClassification.CREATURE).remove(EntityType.PIG);

 

  • Author
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 ?

 

  • Author
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...
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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.