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

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

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

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.