Jump to content

[1.12.2] custom entity/mob | missing spawnegg [Solved]


Recommended Posts

Posted (edited)

Hey guys,

Im very new to modding, especially in creating mobs. I tried to create one, but Im missing the spawnegg. I used a tutorial to create it.

I hope that anybody can help me. For development I use Forge-1.12.2-14.23.4.2705-mdk.

DeBugger (probably not a debugger ;D)

 

PS:

I dont have advanced Java kowledge. I hope thats okay and enough ;)

EntityInit:

  Reveal hidden contents

EntityCyborg1:

  Reveal hidden contents

 

Edited by DeBugger
Posted

Sorry that Im not very good informed about modding. Do I have to set a creativetab for the spawnegg? I registered now the spawnegg and the entity in different methods:

  Reveal hidden contents

Its still not working. Eclipse dont highlight any errors. Only two lines in consoles log make me worried:
 

Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at CLIENT

Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at SERVER

Are this messages important for my problem?

Posted
  On 9/2/2018 at 11:09 AM, DeBugger said:

cb

Expand  

cb is a terrible modid.

 

  On 9/2/2018 at 11:09 AM, DeBugger said:

EntityRegistry

Expand  

Do not use EntityRegistry. Use RegistryEvent.Register<EntityEntry> and build EntityEntries using EntityEntryBuilder similar to how I do here.

 

Apart from that everything looks correct to me. Put a breakpoint in your registerEntities method and see if it is executed at all.

Posted

No, I use it to call clinit and make the data parameters of the entities initialize so both the client and the server are aware of them. I've had an issue with the client not having the parameters initialized and the corresponding client->server connection crashes. This is just a hacky fix I've implemented to solve that problem.

Posted

Okay, so far MC crahes with the excpetion:

Caused by: java.lang.IllegalArgumentException: Method public static void com.cb.cyborg.util.handlers.RegistryHandler.preInitRegistries() has @SubscribeEvent annotation, but requires 0 arguments.  Event handler methods must require a single argument.

But I need the arguments

RegistryEvent.Register<EntityEntry> event

?. I have no clue how to make it work. Sorry, Im (very) basic in Java and modding.

Posted

As the error message tells you you need a RegistryEvent.Register<EntityEntry> as an argument to your event handler(you currently have no arguments at all). When you declare an event handler you specify the event you listen to by having that event as the argument to the listener method.

Posted

Thank you for the link. Isnt this my EventHandler/Listener?:

RegistryHandler:

  Reveal hidden contents

And here the method in EntityInit:

  Reveal hidden contents

 

Posted
  On 9/2/2018 at 12:29 PM, DeBugger said:

        EntityInit.instance.registerEntities(event);

Expand  

 

  On 9/2/2018 at 12:29 PM, DeBugger said:

public static void registerEntities(RegistryEvent.Register<EntityEntry> event)

Expand  

If the method is static you don't need an instance to invoke it. This is basic java.

 

As long as RegistryHandler is subscribed to the event bus this will work, yes.

  • Thanks 1
Posted

I think that I now know my failure: my preInitRegistries SubscribeEvent dont contain an argument.

  Reveal hidden contents

It also is logged in the console.

Posted (edited)

Okay, I corrected the failure. MC doesnt crash anymore, but I still dont have a spawnegg. I summoned the mob per command, and a "Zombie" were summoned. Now I have three problems:

  1. Zombie has default zombie-texture
  2. no spawnegg
  3. custom mob-model isnt used
Edited by DeBugger
Posted
  On 9/2/2018 at 1:10 PM, DeBugger said:

Okay, I corrected the failure. MC doesnt crash anymore, but I still dont have a spawnegg. I summoned the mob per command, and a "Zombie" were summoned. Now I have two problems:

  1. Zombie has default zombie-texture
  2. no spawnegg
Expand  

What do you mean no spawn egg? does it exist with /give? please post your logs & your EntityCyborg class

 

Register your egg inside the builder.

Have a look at https://github.com/Cadiboo/WIPTechAlpha/blob/28bbf1ca75d6a02445838c3f4742a80ee6adc7f7/src/main/java/cadiboo/wiptech/EventSubscriber.java#L280-L290 for an example. 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

Log:

  Reveal hidden contents

EntityCyborg1.class:

  Reveal hidden contents

 

My current problems are:

  • no spawnegg (even throu /give, so far)
  • default zombie model
  • default zombie-texture
Posted

Perhaps this is also helpful.

RenderCyborg1:

  Reveal hidden contents

RenderHandler:

  Reveal hidden contents

RegistryHandler:

  Reveal hidden contents

 

Posted
  On 9/2/2018 at 1:27 PM, Cadiboo said:

please post your logs & your EntityCyborg class

Expand  

the actual entity class please

 

  On 9/2/2018 at 1:27 PM, Cadiboo said:
Expand  

 

I don't see where preInitRegistries() is being called.

You should probably try registering your entity renders like this.

https://github.com/Cadiboo/WIPTechAlpha/blob/fc508e4dd439603888ca2caf08c0b871372764d4/src/main/java/cadiboo/wiptech/EventSubscriber.java#L325-L332 

  • Thanks 1

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

I will try it. What do you mean with "actual entity class"? I poste it. Later I will add an AI but at the moment the mob should perform actions like a zombie. I havnt delete anything.

Posted
  On 9/2/2018 at 2:03 PM, DeBugger said:

I will try it. What do you mean with "actual entity class"? I poste it. Later I will add an AI but at the moment the mob should perform actions like a zombie. I havnt delete anything.

Expand  

The class that extends Entity____

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.

Posted (edited)

Here it is:

  Reveal hidden contents

Or do you mean the EntityZombie-class? I have a DevWorkspace setup, so I cant reach the MC-sourcecode. Sorry.

Edited by DeBugger
Posted
  On 9/2/2018 at 3:14 PM, DeBugger said:

Or do you mean the EntityZombie-class?

Expand  

No. You should never post vanilla code. What you posted is what was required.

  On 9/2/2018 at 3:14 PM, DeBugger said:

I have a DevWorkspace setup, so I cant reach the MC-sourcecode.

Expand  

Yes you can. Its under Referenced Libraries.

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.

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.