Jump to content

[1.8][SOLVED]Custom Entity is Invisible!


NerdByFate

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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