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, when I spawn my custom entity, I can't see it. That's about it. Here's my source code (along with texture files and such): http://github.com/33kingkiller/Final-Smash-Mod

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

  • Author

I have changed EntitySmashRegistry.java to look like this:

 

 

package am.dx._33kingkiller_hub.entity;

 

import net.minecraft.entity.EntityList;

import net.minecraftforge.fml.common.registry.EntityRegistry;

import am.dx._33kingkiller_hub.entity.passive.EntitySmashCube;

import am.dx._33kingkiller_hub.main.Smash;

 

public class EntitySmashRegistry {

 

//Referred to by Smash.java.

public static void EntityRegistry() {

RegisterEntity();

}

 

//Registers entities to eggs.

public static void RegisterEntity() {

CreateEntity(EntitySmashCube.class, "SmashCube", 0x4800FF, 0xFFB600);

}

//Creates/tracks entities.

@SuppressWarnings("unchecked")

public static void CreateEntity(@SuppressWarnings("rawtypes") Class entityClass, String entityName, int solidColour, int spotColour) {

int entityID = 27;

 

EntityRegistry.registerModEntity(entityClass, entityName, entityID, Smash.modInstance, 64, 1, true);

 

CreateEgg(entityID, solidColour, spotColour);

}

 

//Creates entity eggs.

@SuppressWarnings("unchecked")

public static void CreateEgg(int randomID, int solidColour, int spotColour) {

EntityList.entityEggs.put(Integer.valueOf(randomID), new EntityList.EntityEggInfo(randomID, solidColour, spotColour));

}

 

}

 

 

 

Now I get "[14:43:56] [server thread/WARN]: Skipping Entity with id SmashCube" in the console, and the in-game egg is just called "Spawn". The egg no longer does anything. Any idea why?

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

  • Author

So how can I go about custom spawn eggs?

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

You cannot use the vanilla spawn eggs for your own entity.

 

You cannot use create egg anymore? Huh That sucks.

So how can I go about custom spawn eggs?

 

My best bet is that you have to make it yourself (which isn't that hard really)

  • Author

I have changed EntitySmashRegistry.java to this now:

 

 

package am.dx._33kingkiller_hub.entity;

 

import net.minecraft.entity.EntityList;

import net.minecraftforge.fml.common.registry.EntityRegistry;

import am.dx._33kingkiller_hub.entity.passive.EntitySmashCube;

import am.dx._33kingkiller_hub.main.Smash;

 

public class EntitySmashRegistry {

 

//Referred to by the Smash.java.

public static void EntityRegistry() {

RegisterEntity();

}

 

//Registers entities to eggs.

public static void RegisterEntity() {

CreateEntity(EntitySmashCube.class, "SmashCube", 0x4800FF, 0xFFB600, 27);

}

//Creates/tracks entities.

@SuppressWarnings("unchecked")

public static void CreateEntity(@SuppressWarnings("rawtypes") Class entityClass, String entityName, int solidColour, int spotColour, int entityID) {

EntityRegistry.registerModEntity(entityClass, entityName, entityID, Smash.modInstance, 64, 1, true);

 

CreateEgg(entityClass, entityName, entityID, solidColour, spotColour);

}

 

//Creates entity eggs.

@SuppressWarnings("rawtypes")

public static void CreateEgg(Class entityClass, String entityName, int entityID, int solidColour, int spotColour) {

EntityList.addMapping(entityClass, entityName, entityID, solidColour, spotColour);

}

 

}

 

 

I can spawn the entity again, but it is still invisible. I guess it's "back to square one," as they say.

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

  • Author

Okay, I have found this: https://github.com/MinecraftForge/MinecraftForge/issues/1703. This seems to further explain what you mean by, "don't use global ids." I should be able to take it from here, but I will get back to you if I have any further issues.

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

  • Author

Okay, so my problem had nothing to do with global IDs at all (although I won't be using them in the future). It turns out that I added an extra Entity variable to the "render" method in "ModelSmashCube.java." Thanks for your help, topic closed.

"All that is gold does not glitter,

    Not all those who wander are lost;

    The old that is strong does not wither,

    Deep roots are not reached by the frost.

 

    From the ashes a fire shall be woken,

    A light from the shadows shall spring;

    Renewed shall be blade that was broken,

    The crownless again shall be king." - J.R.R Tolkien

Guest
This topic is now closed to further replies.

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.