Posted June 24, 20178 yr Hello again, I am making an arrow-like entity which extends EntityArrow but i can figure out how to register it. Can anyone help me? Edited June 24, 20178 yr by drok0920 Solved
June 24, 20178 yr Use EntityRegistry.registerModEntity in preInit to register an entity. Use RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit from a client-only class to register an entity renderer. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 24, 20178 yr Author 1 minute ago, diesieben07 said: The ID for your entity. Sorry still not clear. Can you give me an example of what i put there?
June 24, 20178 yr Just now, drok0920 said: Sorry still not clear. Can you give me an example of what i put there? The ID of your entity which is unique to your mod. Aka "pick a bloody number." 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.
June 24, 20178 yr Author 2 minutes ago, Draco18s said: The ID of your entity which is unique to your mod. Aka "pick a bloody number." I "put a bloody number" where you said and i get an error because it wants a resource location not an int. EntityRegistry.registerModEntity(1000, EntityLeadBullet.class, "", 100, GunMod.instance, 0, 1, true); Edited June 24, 20178 yr by drok0920
June 24, 20178 yr Sorry, I forgot that the ID changed from a number to a resource location. The answer is still "make a resource location that is your entity's ID." It can be freaking anything and it doesn't bloody matter. All that matters is that it is unique within your mod. 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.
June 24, 20178 yr The ResourceLocation parameter is the registry name of your entity, which should have your mod ID as the domain and a name unique within your mod as the path. This is just like the registry name of a Block, Item or other IForgeRegistryEntry implementation. The String parameter is the unlocalised name of your entity, used for translation/display purposes. I recommend using the String form of the registry name as the unlocalised name. Edited June 24, 20178 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 24, 20178 yr Author Ok so this is what i should do? EntityRegistry.registerModEntity(new ResourceLocation("modID", "leadBullet"), EntityLeadBullet.class, "leadBullet", 100, GunMod.instance, 0, 1, true); Also does id matter? (where i just temporarily put 100) like is it id within the mod or within the game. Edited June 24, 20178 yr by drok0920 Expanded on question
June 24, 20178 yr 25 minutes ago, drok0920 said: Ok so this is what i should do? EntityRegistry.registerModEntity(new ResourceLocation("modID", "leadBullet"), EntityLeadBullet.class, "leadBullet", 100, GunMod.instance, 0, 1, true); Also does id matter? (where i just temporarily put 100) like is it id within the mod or within the game. Replace "modID" with your actual mod ID and include your mod ID in the unlocalised name (e.g. by making it the String form of the registry name ResourceLocation). The numeric ID can be any number unique to your mod, though it's probably easiest if you start from 0 and increment by 1 each time you register an entity. It's used in the entity spawn packet. You can see how I register my mod's entities here. Edited June 24, 20178 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 24, 20178 yr Author Just now, Choonster said: Replace "modID" with your actual mod ID and include your mod ID in the unlocalised name (e.g. by making it the String form of the registry name ResourceLocation). The numeric ID can be any number unique to your mod, though it's probably easiest if you start from 0 and increment by 1 each time you register an entity. You can see how I register my mod's entities here. Ok thank you for all the help!
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.