Jump to content

Recommended Posts

Posted

Hey, I've got this weird issue where my mob won't spawn outside in the world, and only near the player's entry point to the world.

 

Spawn/Entity code (located in init method)

  Reveal hidden contents

 

Posted

Here it is:

@Override
public boolean getCanSpawnHere()
{
	return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL;
}

 

I changed the frequency to 3 and they still would only spawn near the world entrance. Also, why is 205 taken? When I changed it to a final int, I set it at 400, nothing spawned at all.

Posted

Vanilla global entity IDs only go up to 255, which is why it is HIGHLY recommended NOT to use them, and use only the registerModEntity. In 1.8, you don't need to manually add mappings like that anymore to get a spawn egg, you can use instead EntityRegister#registerEgg.

 

The frequency I mentioned is not related to spawn rate, just something I see all the time that is probably not very good to do.

 

Put some println statements in your mob's onInitialSpawn method and see if that is getting called. Also, you probably want to call super.getCanSpawnHere() - the super methods generally have useful checks, depending on what class your mob extends.

 

 

Posted

So I changed the registry to this:

int id = 600;

	EntityRegistry.registerModEntity(EntityMimic.class, "rpgMimic", BrightRPG.ENTITY_MIMIC_ID, BrightRPG.instance, 80, 3, true);
	EntityRegistry.addSpawn(EntityMimic.class, 85, 3, 7, EnumCreatureType.CREATURE,
			BiomeGenBase.desert,  BiomeGenBase.beach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.desertHills, BiomeGenBase.extremeHills,
			BiomeGenBase.extremeHillsEdge, BiomeGenBase.extremeHillsPlus, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleEdge,
			BiomeGenBase.jungleHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.plains,
			BiomeGenBase.river, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau);

	EntityList.idToClassMapping.put(id, EntityMimic.class);
	EntityList.entityEggs.put(id, new EntityEggInfo(id, 113213, 3523523));

	id++;

 

I did some more experimenting and it seems that they'll just despawn as soon as I look away. I also can't find the onInitialSpawn method in EntityMob, EntityCreature, EntityLiving or EntityLivingBase.

Posted

I'll update MCP in a sec, here's the entity code. It's pretty barebones right now:

  Reveal hidden contents

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.