Jump to content

Creating Spawn Eggs


Willatendo

Recommended Posts

36 minutes ago, Willatendo said:

If some has the code for it, please send it my way.

That's not a good way to problem solve. Asking for the answer without even showing an attempt is just bad. I'll explain the process that's needed; however, someone else can just give you the code.

 

There are a few things to note. First, you can't use the normal spawn egg method as it doesn't contain supplier for later access. Items are registered before entities so they will not go into a spawn egg. So basically, you need to create your own SpawnEggItem extension that takes in a supplier, passes in a null value for the original, overrides the default entity type gotten from the egg, and adds the unadded eggs to the original list using via reflection after entity types have been registered. You might want to take a look at how SpawnEggs are stored and how their dispenser behavior is handled before attempting this.

 

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.



×
×
  • Create New...

Important Information

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