Jump to content

Mob invisible, makes sounds, has shadow, has hitbox, just can't see it.


Recommended Posts

Posted

Hi, having the problem the title says.

 

My Render file:

http://pastebin.com/tgXjjG1Y

 

The Model:

http://pastebin.com/bHL9d0uw

 

The Entity file:

http://pastebin.com/LZP9B1Y5

 

As for the main class, mine is extensive but this is anything regarding mobs:

 

 

 

@SidedProxy(clientSide = "infectModding.common.ClientProxy", serverSide = "InfectionModding.common.CommonProxy")

private static int startEntityId = 300;

 

 

public EternIsles() {

  EntityRegistry.findGlobalUniqueEntityId();

  EntityRegistry.registerGlobalEntityID(EntityIcer.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

  EntityRegistry.addSpawn(EntityIcer.class, 10, 2, 4, EnumCreatureType.creature);

  registerEntityEgg(EntityIcer.class, 0x0099FF, 0xFFFFFF);

}

 

private void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) {

int id = getUniqueEntityId();

EntityList.IDtoClassMapping.put(id, entity);

EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));

 

 

}

 

private int getUniqueEntityId() {

 

do {

startEntityId++;

}

while(EntityList.getStringFromID(startEntityId) != null);

return startEntityId++;

}

 

@EventHandler public void load(FMLInitializationEvent event){

proxy.RenderInformation();

}

 

 

 

and this is called in the client proxy

 

public void RenderInformation(){

RenderingRegistry.registerEntityRenderingHandler(EntityIcer.class, new RenderIcer(new Hunch(), 0.5F));

 

}

Posted

Replace super.doRender with super.doRenderLiving in your renderHunch method.

 

Also I suggest you add @Override above the methods you intend to override for debugging purposes.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Replace super.doRender with super.doRenderLiving in your renderHunch method.

 

Also I suggest you add @Override above the methods you intend to override for debugging purposes.

I havee a super.doRenderLiving already in the file right above it.

Posted

    EntityRegistry.findGlobalUniqueEntityId();
   EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

Replace it with

EntityRegistry.registerModEntity(EntityHunch.class, "Hunch", 0, this, 128, 1,true); 

Posted

    EntityRegistry.findGlobalUniqueEntityId();
   EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

Replace it with

EntityRegistry.registerModEntity(EntityHunch.class, "Hunch", 0, this, 128, 1,true); 

Crashes the mod, I also don't see why this would fix the rendering issue.

Posted

It's appearing though [has a shadow on the ground, circular] and making sounds, just not visible. To clarify, I'm doing this on MC 1.7 for Forge1024.

 

It crashes with this crash report when I replace it:

 

 

 

Apr 08, 2014 3:47:40 PM com.google.common.eventbus.EventBus dispatch

SEVERE: Could not dispatch event: cpw.mods.fml.common.event.FMLConstructionEvent@1c79e65 to handler [wrapper public void cpw.mods.fml.common.FMLModContainer.constructMod(cpw.mods.fml.common.event.FMLConstructionEvent)]

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:487)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561)

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

Caused by: java.lang.NullPointerException

at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:163)

at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)

at infectModding.common.EternIsles.<init>(EternIsles.java:100)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509)

... 32 more

 

[15:47:40] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue

[15:47:40] [Client thread/ERROR] [FML]:

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed

eternisles{Alpha 1.5} [eternisles] (bin) Unloaded->Errored

[15:47:40] [Client thread/ERROR] [FML]: The following problems were captured during this phase

[15:47:40] [Client thread/ERROR] [FML]: Caught exception from eternisles

java.lang.NullPointerException

at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:163) ~[EntityRegistry.class:?]

at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149) ~[EntityRegistry.class:?]

at infectModding.common.EternIsles.<init>(EternIsles.java:100) ~[EternIsles.class:?]

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_51]

at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_51]

at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173) ~[iLanguageAdapter$JavaAdapter.class:?]

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509) ~[FMLModContainer.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) ~[LoadController.class:?]

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) ~[LoadController.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

at cpw.mods.fml.common.Loader.loadMods(Loader.java:487) [Loader.class:?]

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

---- Minecraft Crash Report ----

// Sorry :(

 

Time: 4/8/14 3:47 PM

Description: Initializing game

 

java.lang.NullPointerException: Initializing game

at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:163)

at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)

at infectModding.common.EternIsles.<init>(EternIsles.java:100)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:487)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561)

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at cpw.mods.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:163)

at cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)

at infectModding.common.EternIsles.<init>(EternIsles.java:100)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:487)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

at net.minecraft.client.main.Main.main(Main.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 8 (x86) version 6.2

Java Version: 1.7.0_51, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 795488072 bytes (758 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed

eternisles{Alpha 1.5} [eternisles] (bin) Unloaded->Errored

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: GeForce GT 630/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

Anisotropic Filtering: Off (1)

#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Brendan\Downloads\The Isles\eclipse\.\crash-reports\crash-2014-04-08_15.47.40-client.txt

 

 

 

 

Posted

Everything else works though, it's only the mob that doesn't. And that isn't my whole main class, I only included the parts that have anything to do with this mob. I'm aware this main class doesn't "outsource" stuff to different files [like the registry, recipes, and whatnot] but I'm not worried about that at the moment.

Posted

Ho and clean the first three methods in RenderHunch, and its "Hunch model" field. They are useless.

Not quite sure what you mean by clean. If you mean remove, then I'm not sure how removing these render lines will make my mob appear. If you are saying fix, could you elaborate? I know there's something wrong obviously, but I don't know what. So telling me to "fix it" is pretty useless because I came here since I don't know what to fix.

Posted

Are you referring to these to be removed (from RenderHunch.class)?: (Removing them doesn't fix the problem, but it doesn't change the situation either)

 

 

public void renderHunch(EntityHunch entity, double par2, double par4, double par6, float par8, float par9){

super.doRender(entity, par2, par4, par6, par8, par9);

}

 

 

public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){

renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9);

}

 

public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){

renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9);

this.func_110827_b(par1EntityLiving, par2, par4, par6, par8, par9);

 

}

 

 

Posted

Your main class is completely wrong. Read the tutorials. Particularly about proxies.

 

This is the problem, you need to register your entities in

       @EventHandler
       public void PreInit(FMLPreInitializationEvent event)
       {
       }

 

Not in the constructor.

 

 

Posted

So I tried moving the entity registry:

 

 

public EternIsles() {

  EntityRegistry.findGlobalUniqueEntityId();

  EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

  EntityRegistry.addSpawn(EntityHunch.class, 10, 2, 4, EnumCreatureType.creature);

  registerEntityEgg(EntityHunch.class, 0x0099FF, 0xFFFFFF);

}

 

 

 

into my:

@EventHandler public void load(FMLInitializationEvent event){

*here it gets inserted*

proxy.RenderInformation();

}

 

 

However it doesn't seem to fix the issue.

Posted

*facedesk*

 

Let me repeat "exactly" what darty11 said.

 

@EventHandler
public void PreInit(FMLPreInitializationEvent event)
{
}

 

If you actually read the changes in 1.7 you would know.

You are placing it in FMLInitializationEvent; Forge doesn't use that anymore for these kinds of registrations.

Posted

*facedesk*

 

Let me repeat "exactly" what darty11 said.

 

@EventHandler
public void PreInit(FMLPreInitializationEvent event)
{
}

 

If you actually read the changes in 1.7 you would know.

You are placing it in FMLInitializationEvent; Forge doesn't use that anymore for these kinds of registrations.

My bad, also I'm not updating a mod, I haven't worked with Minecraft in several versions.

 

When I move the registration into there, I just get a white block as my mob.:

 

 

@EventHandler

public void PreInit(FMLPreInitializationEvent event){

EntityRegistry.findGlobalUniqueEntityId();

  EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

  EntityRegistry.addSpawn(EntityHunch.class, 10, 2, 4, EnumCreatureType.creature);

  registerEntityEgg(EntityHunch.class, 0x0099FF, 0xFFFFFF);

}

 

 

Posted

1 question does the white block take the shape of your model but just white or is it just a white cuboid? If it is the first then it can't find your texture so it is using the missing texture icon

It's just a white cube, about half a block tall and 1x1 in length and width. Not the shape of my model.

Posted

Ok, Good! [spoiler=For future reference]That means that your entity is defined, but it doesn't have any rendering, so it uses the default rendering (which is a white cube the shape of your entities hit-box).

 

 

Now move EVERYTHING in your

@EventHandler public void load(FMLInitializationEvent event)

to your

@EventHandler
public void PreInit(FMLPreInitializationEvent event)

Posted

Ok, Good! [spoiler=For future reference]That means that your entity is defined, but it doesn't have any rendering, so it uses the default rendering (which is a white cube the shape of your entities hit-box).

 

 

Now move EVERYTHING in your

@EventHandler public void load(FMLInitializationEvent event)

to your

@EventHandler
public void PreInit(FMLPreInitializationEvent event)

It was already removed when I previously moved the mob code, as that was the only existing code in there. So the box below is all that is in the PreInt and the other one is completely empty.

 

 

@EventHandler

public void PreInit(FMLPreInitializationEvent event){

EntityRegistry.findGlobalUniqueEntityId();

  EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

  EntityRegistry.addSpawn(EntityHunch.class, 10, 2, 4, EnumCreatureType.creature);

  registerEntityEgg(EntityHunch.class, 0x0099FF, 0xFFFFFF);

}

 

 

Posted

Ok, then add proxy.RenderInformation(); at the bottom of preinit, and

    EntityRegistry.findGlobalUniqueEntityId();
   EntityRegistry.registerGlobalEntityID(EntityHunch.class, "Hunch", EntityRegistry.findGlobalUniqueEntityId());

Replace it with

EntityRegistry.registerModEntity(EntityHunch.class, "Hunch", 0, this, 128, 1,true); 

This is the correct way to do it and if you don't it will come back to bite you eventually.

Posted

Okay so I replaced it and I added the RenderInf (accidentally removed it earlier). The mob returns to being invisible.

 

I now have this as my event handler:

 

 

@EventHandler

public void PreInit(FMLPreInitializationEvent event){

EntityRegistry.registerModEntity(EntityHunch.class, "Hunch", 0, this, 128, 1,true);

EntityRegistry.addSpawn(EntityHunch.class, 10, 2, 4, EnumCreatureType.creature);

registerEntityEgg(EntityHunch.class, 0x0099FF, 0xFFFFFF);

proxy.RenderInformation();

}

 

 

Posted

Try trimming your render hutch file down to

	

    package infectModding.mob.render;
     
    import infectModding.mob.Hunch;
    import infectModding.mob.entity.EntityHunch;
    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.renderer.entity.RenderLiving;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.util.ResourceLocation;
     
    public class RenderHunch extends RenderLiving {
    private static final ResourceLocation EntityTexture = new ResourceLocation("Fakelocationtogetthedefaulttexturetomakesureyourtextureisnottheproblem")//"eternisles:textures/mobs/hunch.png");
            @Override
            protected ResourceLocation getEntityTexture(Entity entity) {
                   
                    return EntityTexture;
            }
     
    }

And use a different model when defining the renderer.

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.