Jump to content

[1.7.2]Spawn egg crashes when right-click held down for multiple spawns


Recommended Posts

Posted

Okay, so I have an entity (a tiger) that spawns naturally fine and also has a spawn egg that works if I use it singly.  I mean if I right-click it spawns a tiger, and if I right-click again it spawns another tiger, but if I hold right-click (for multiple spawns) the game crashes (seems to be right after first tiger spawned, although I'm not certain).  It must be some code I modified recently because previously it worked (it would spawn a bunch of tigers including baby tigers).

 

The NetHandlerPlayClient seems to be having trouble, but I swear I haven't modified any code related to the networking.

 

Here is the console error:

 

  Reveal hidden contents

 

 

I can post more code, but not sure what would be related.  I suppose that it may be trying to create a baby tiger and that is failing?  Here is the only code I think I have that is related to baby tigers -- in the model class render method it checks for isChild and scales the body accordingly:

 

  Reveal hidden contents

 

 

Here is where I register the spawn egg in case that matters:

 

  Reveal hidden contents

 

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

Posted

Bump.

 

Sorry for bumping, but I still need help on this one.  The error unfortunately doesn't give me a lot of ideas on where the problem may lie.  The thing is that at one point this worked, I could spawn lots of my EntityTiger including the baby ones, but now all my entities invariably crash the game when spawning multiples from the spawn egg.

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

Posted

Are you checking if you are spawning on the server-side?

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted
  On 4/12/2014 at 8:32 PM, Mecblader said:

Are you checking if you are spawning on the server-side?

 

How would I check? 

 

All I do is register the spawn in my CommonProxy.  That seems to create a spawn egg in the Miscellaneous tab of the creative inventory.

 

When my entities spawn I have a console print that indicates that the constructor was called.  I only see it being called once, so I think it is only being called on one side.  I guess I can add to the print to see what side it is being called on.

 

Also, as I mentioned, I can spawn the entities one at a time with the spawn egg just fine. 

 

In particular, why are you asking about the server side:

1) should I only register the spawn on one side?

2) should the spawn happen on server or client?  I'm assuming it should happen on the server, right, since the server keeps track of the game world?

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

Posted

Yeah all spawning should happen server-side and all rendering should happen client-side. As for why you can't spawn multiple mobs with your spawn egg, try to register the spawn egg in the client-proxy. I know that all spawning should happen server-side, but I don't understand why you can only spawn one and not more. Do you have some sort of special AI for acting differently around another mob of the same type?

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted

Okay, I take it back -- it seems that the constructor is being called twice per spawn.  I assume that it is on each of the Client and Server side, I'll put in some debug messages in a sec.

 

Why do you say register in ClientProxy?  Did you mean ServerProxy so it is only on server side?

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

Posted

Actually you seem to be on to something with your question about any interaction between entities.  I found that if I try to spawn my custom entity on top of one that already exists (even just clicking spawn egg one at a time) I get the same crash.

 

I don't know that I have any special code related to this -- my entities are basically wolves but with tiger textures.  But maybe I'll go through my AI bit by bit enabling/disabling to see if anything seems related.  Anyway, thanks I think this gives me something to dig into.

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

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