Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author

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?

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

cb

cb is a terrible modid.

 

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

EntityRegistry

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.

  • Author

Do I also need something like your Helpers-class?

EDIT: I think I found it out by myself. Sorry.

Edited by DeBugger

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.

  • Author

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.

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.

  • Author

Where do I have to declare the handler? In the EntityRegistry, EntityInit... Im sorry if I get on your nerves?

  • Author

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

RegistryHandler:

Reveal hidden contents

And here the method in EntityInit:

Reveal hidden contents

 

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

        EntityInit.instance.registerEntities(event);

 

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

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

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.

  • Author

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.

  • Author

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

  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

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)

  • Author

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
  • Author

Perhaps this is also helpful.

RenderCyborg1:

Reveal hidden contents

RenderHandler:

Reveal hidden contents

RegistryHandler:

Reveal hidden contents

 

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

please post your logs & your EntityCyborg class

the actual entity class please

 

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

 

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 

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)

  • Author

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.

  • Author

What is your ModResourceLocation-class?

Are Im allowed to copy-paste your ModResourceLocation-class code?

Edited by DeBugger

  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.

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.

  • Author

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

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

Or do you mean the EntityZombie-class?

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.

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.

  • Author

Okay, thank you. Thank you too for the tip with referenced libraries. Im a very beginner?

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.