Jump to content

Custom Mob error


MrParker

Recommended Posts

As part of a school project I am leading we are trying to make our own mobs, including some of the teachers as mobs.

I have followed a tutorial and it worked but any attempt to repeat it with a new mob just doesn't run.

I am very familiar with Java just not this frame work.

The error occurs when the model is being attempted to be rendered.

I have attached the necessary files below, any help is greatly appreciated.

My pupils are really looking forward to adding in their teachers to the game.

 

All the file paths are correct to the best of my knowledge and the model was built using Techne, I know the texture is a default one but the pupils can change that.

 

Any information I have missed that you need let me know.

 

Currently it compiles with no errors but when the game launches and the entity is spawned the console returns the error on line 24 of the renderMrGed file which is where the texture is called despite it being present

 

code found here

Code

 

 

MrGeddis.png

 

 

 

 

Edited by MrParker
Update with requested information
Link to comment
Share on other sites

As mentioned there are several type of possible errors. Were there console errors/warnings during the loading of the mod indicating a problem with resource assets? Was there continuous console errors when the entity was trying to render? Do you mean that the model just looks different than intended? Do you mean the entity never appears but there are no errors reported?

 

Please describe which case it is and if it is an actual console error please post the logs to Gist or Pastebin as requested above.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

MrParker, Forge is free  cost and open source so upgrading shouldn't be any issue for educational purposes.

 

However, since this is a request for supporting kids getting into coding I hope the forum here will make an exception and provide support one way or another. I'm at work, but I'll certainly take a look and help if I can.

 

Note: MrParker -- this sort of thing is a really good teaching moment for your students about debugging code. I realize you may not have a lot of time to devote to the subject. But crawling through the console errors, looking at the lines of code that are errored, running the mod in debug mode and so forth are hopefully something you will discuss. Also the way to research and recruit support online.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

14 minutes ago, jabelar said:

MrParker, Forge is free  cost and open source so upgrading shouldn't be any issue for educational purposes.

Forge is, yes, but not Minecraft.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Okay, the stack overflow error is a bit weird at that line of code.

 

I looked through your code and one thing that stands out is that you're double-registering your entities. You shouldn't use the global id registration. At the time of 1.7.10 they were transitioning from the global registration to per-mod id, but you should only use the mod id one. Furthermore, you don't need to set it based on the getGlobalUniqueID(0 method, but rather simply start at 0 for your mod and increment for each one.

 

For example, in my mods I had something like this:

     protected int modEntityID = -1;

     public void registerModEntity(Class parEntityClass, String parEntityName)
     {
            EntityRegistry.registerModEntity(parEntityClass, parEntityName, ++modEntityID, WildAnimals.instance, 80, 3, false);
     }

 

You'll note that I use a pre-increment ++ on the id so that if this gets called multiple times it will get the next id for next entity registered.

 

I'm not sure but potentially the double-registering of your entities could cause some problem during rendering so maybe clean that up and see if it helps.

Edited by jabelar
  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

16 minutes ago, jabelar said:

You'll note that I use a pre-increment ++ on the id so that if this gets called multiple times it will get the next id for next entity registered.

Postfix would made more sense: you're skipping the perfectly good ID 0. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

5 hours ago, jabelar said:

For example, in my mods I had something like this:


     protected int modEntityID = -1;

     public void registerModEntity(Class parEntityClass, String parEntityName)
     {
            EntityRegistry.registerModEntity(parEntityClass, parEntityName, ++modEntityID, WildAnimals.instance, 80, 3, false);
     }

 

You'll note that I use a pre-increment ++ on the id so that if this gets called multiple times it will get the next id for next entity registered.

 

I'm not sure but potentially the double-registering of your entities could cause some problem during rendering so maybe clean that up and see if it helps.

Great my students and I have been trying to sort this for a week. Didn't think of the ID thought it was randomised. Will look into this and report back.

The ++increment should run the entire mod and sort out most things, I hope.

 

Thanks, will reply soon

Link to comment
Share on other sites

I have tried the following to no success;

  • Changed the ID to increment, either caused a blank spawn egg that did nothing or still crashed the game when the first entity was spawned
  • Tried changing the model, encase there was an error there, still crashed when one was spawned
  • Tried redoing the texture to a solid colour encase there was an issue with the texture, still crashed

All of these with the same error as before, line 24 in the render file where it returns the texture for the entity.

Any other advice or things to try would be nice, or even a nudge in the direction of a tutorial guide my students could follow that someone knows to work, or, any files that anyone has where they have created multiple custom mobs would also be great

 

Thanks for the help so far

Link to comment
Share on other sites

9 hours ago, MrParker said:

I have tried the following to no success;

  • Changed the ID to increment, either caused a blank spawn egg that did nothing or still crashed the game when the first entity was spawned
  • Tried changing the model, encase there was an error there, still crashed when one was spawned
  • Tried redoing the texture to a solid colour encase there was an issue with the texture, still crashed

All of these with the same error as before, line 24 in the render file where it returns the texture for the entity.

Any other advice or things to try would be nice, or even a nudge in the direction of a tutorial guide my students could follow that someone knows to work, or, any files that anyone has where they have created multiple custom mobs would also be great

 

Thanks for the help so far

So you got rid of the global id registration?

 

Regarding the spawn egg, in 1.7.10 you need to create a custom egg (actual class for egg is called monster placer). See my tutorial link below on how to do that.

 

I have an open source mod for 1.7.10 with multiple mobs. Feel free to adapt it to your needs here: https://github.com/jabelar/WildAnimalsPlus-1.7.10. I also have tutorials on custom entities here: http://jabelarminecraft.blogspot.com/p/creating-custom-entities.html

Edited by jabelar
  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

So had a look and changed from using extends livingAnimal to extends Biped, followed a new guide and seems to have solved the problem with the ID's by incrementing as I was previously shown on this thread but for some reason I cant spot, it worked this time. Now to just include textures which is where it erred last time but am currently able to create two different texture less mobs. Big thanks to everyone's support so far

Link to comment
Share on other sites

It all works thanks for all your support for helping education. My pupils are very keen on this project. Computing and programming are not seen as popular or cool choices in the school I am in so we are trying all sorts of ways to introduce the students to programming.

 

Thanks again

Link to comment
Share on other sites

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.