Jump to content

1.7.10 Entity spawn egg

Recommended Posts

so I am trying to make a spawn egg for a new mob in my mod, problem is when I try to spawn the entity, the console says the entity with the id of (My ID) has been skipped. so I go to check a tutorial to see if I did it right, turns out there were some differences, but no matter what I still got the same error. heres my stuff


Entity Class

package com.OlympiansMod.entity;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;

import com.OlympiansMod.Main.MainRegistry;

import cpw.mods.fml.common.registry.EntityRegistry;

public class MEntity {
public static void MainRegistry(){
public static void registerEntity(){
	createEntity(EntityGreekFire.class, "GreekFire", 0x0004FF, 0x0004FF);
	createEntity(EntityBullet.class, "Bullet", 0x0004FF, 0x0004FF);
	createEntity(EntitySGuardian.class, "SGuardian", 0x0004FF, 0x0004FF);

public static void createEntity(Class entityClass, String entityName, int solidColour, int spotColour){
	EntityRegistry.registerModEntity(EntityGreekFire.class, "GreekFire", 4013479, MainRegistry.modInstance, 1, 80, true);
	EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 302942, MainRegistry.modInstance, 1, 80, true);
	EntityRegistry.registerModEntity(EntitySGuardian.class, "SGaurdian", 301320, MainRegistry.modInstance, 80, 1, true);

	createEgg(EntitySGuardian.class, 301320, solidColour, spotColour);

private static void createEgg(Class entityClass, int i, int solidColour, int spotColour) {
	EntityList.entityEggs.put(Integer.valueOf(i), new EntityList.EntityEggInfo(i, spotColour, solidColour));




if u need any thing else tell me, btws I modified the code allot to see if I could make it work but it never made a difference.


Im serious don't look at it!!

Link to comment
Share on other sites

I don't think the ID used in the two methods (registerModEntity() and entityList.put()) are the same. The ID for the registerModEntity() is unique for each mod, and can start at 0 and increment. This registration method doesn't have to worry about ID of vanilla or other mods -- in other words there can be multiple mods that all use same ID in this registration.


But I think the entityList.put() uses an "absolute" ID similar to the old global entity ID system. So maybe you need to get the global ID rather than just using the same mod ID.


You can also just create your own spawn egg item, which is the way I tend to do it.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now


  • Create New...

Important Information

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