Jump to content

Recommended Posts

Posted

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(){
	registerEntity();
}
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!!

Posted

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/

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.