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

Hey guys, I recently got my mobs working and stuff but I'm having an issue where one mob will spawn near the world spawn and no other mobs will spawn at all anywhere. Also, How do I set it so I can make it spawn in all biomes without naming them all? You know, Since 1.7 has a ton on them :P

Entity Registry spawn code. Btw this is in my InitHandler

 

//Entities

    EntityRegistry.registerGlobalEntityID(EntityGamingOnCaffeine.class, "GamingOnCaffeine", EntityRegistry.findGlobalUniqueEntityId(), 0x7314AB, 0xFFE600);

    RenderingRegistry.registerEntityRenderingHandler(EntityGamingOnCaffeine.class, new RenderEntityGamingOnCaffeine(new ModelBiped(), 0.5F));

    EntityRegistry.addSpawn(EntityGamingOnCaffeine.class, 10, 1, 3, EnumCreatureType.monster, BiomeGenBase.taigaHills, BiomeGenBase.jungle,

    BiomeGenBase.jungleHills, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.forest,

    BiomeGenBase.forestHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.beach,

    BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.mesa);

   

    EntityRegistry.registerGlobalEntityID(EntityMeatyLock.class, "MeatyLock", EntityRegistry.findGlobalUniqueEntityId(), 0x663333, 0xFF0404);

    RenderingRegistry.registerEntityRenderingHandler(EntityMeatyLock.class, new RenderEntityMeatyLock(new ModelBiped(), 0.5F));

    EntityRegistry.addSpawn(EntityMeatyLock.class, 10, 1, 3, EnumCreatureType.monster, BiomeGenBase.taigaHills, BiomeGenBase.jungle,

    BiomeGenBase.jungleHills, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.forest,

    BiomeGenBase.forestHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.beach,

    BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.mesa);

   

    EntityRegistry.registerGlobalEntityID(EntityKryllyk.class, "Kryllyk", EntityRegistry.findGlobalUniqueEntityId(), 0x38B4BD, 0xFFFFFF);

    RenderingRegistry.registerEntityRenderingHandler(EntityKryllyk.class, new RenderEntityKryllyk(new ModelBiped(), 0.5F));

    EntityRegistry.addSpawn(EntityKryllyk.class, 10, 1, 3, EnumCreatureType.monster, BiomeGenBase.taigaHills, BiomeGenBase.jungle,

    BiomeGenBase.jungleHills, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.forest,

    BiomeGenBase.forestHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.beach,

    BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.mesa);

 

Use the BiomeGenBase array that stores all the biomes. It's BiomeGenBase.biomeList, I believe. BUT BE CAREFUL! I'm pretty sure it's length is 256 and you know, most of the time, it's not taken up fully, so...

 

Alternatively, you can iterate through that list, create an array list, add in the biomes that aren't null, and then convert that to an array and use it.

 

- - -

 

The reason this works is because the last parameter of the addSpawn is a BiomeGenBase array (or "BiomeGenBase...", which at the end of the parameters means an array), so you can use any array of biomes you want.

 

- - -

 

At least, I'm pretty sure that's correct.

 

I hope that helped! :D

-Mitchellbrine

 

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

I don't want your charity, I want your information

Alternatively, you can iterate through that list, create an array list, add in the biomes that aren't null, and then convert that to an array and use it.

 

Or, use Guava: http://www.minecraftforge.net/forum/index.php/topic,17455.msg88353.html#msg88353

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.