Jump to content

Recommended Posts

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);

 

Posted

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
Posted

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

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