Topic category: User side tutorials
This has been bugging me for awhile, and seems to be a pretty common question. Here's what I found from randomly mashing together snippets of different Github repositories until things compiled properly. (I will not pretend to have any decent knowledge of java, nor real understanding of how this stuff works, but it works.)
You'll firstly need to create a ranged item. (A ranged item and a projectile entity, if you're using version 2023.4+. I'm writing this for 2023.3, but the basic idea should be the same.) Add whatever custom procedures, models, stats, etc; for the projectile. Then lock the mod element, open the item JSON file, (the one that ends with 'Item,') and rip out most of the ranged item code.
You instead want it to look something like this:
...Where 'ArrowTestItem' is replaced with the registry name of your item, 'ArrowTestEntity' is replaced with the name of the projectile entity, 'superiorstructures' is replaced with your mod id, 'SuperiorstructuresModEntities' is replaced with the name of your entity init file, (you can check your workspace src folder, but it should just be the same thing, plus a capitalized version of your mod id, since this is how MCreator formats things), and 'ARROW_TEST' is replaced with the name of your projectile as it appears in your entities init file. (Again, you can manually check this in your mod's init files, or just trust MCreator's formatting and do an uppercase version of the item name.)
You will also probably want to change up the display json files so that the item isn't displayed in hand as a tool. (Just remove everything except the 'item generated' bit.)
Anyways, this appears to function in version 2023.3, and I hope this can at least save some people the trouble of searching the forums.
Also, a couple of important side notes:
...Replacing the thing that already looks like this, and making sure to replace 'fabulousfletching' with your Mod ID, and 'FORGED_ARROW' with the name of the item that should be picked up. You'll also need to add your ModItems init file to the imports underneath the ModEntities import.
Also, it's somewhat annoying to find a vanilla arrow model. If you make your own, keep in mind that the vanilla arrows actually have their textures squished by about a third to make them look thinner. You can either rescale your texture to be bigger and thus similarly squished, or find a way to rescale the model.
Thanks! That is a useful tutorial!
Could you provide the workspace with everything that involves the arrow? I'm having problems with the texture, to be more exact ModEntities.MOD_ARROW.get() in the ArrowEntity.java
Tutorial for 1.16.5 (2022.1) when?
vanilla bows don't shoot it?
A few more things you can add to make this better,
1, the item needs to be tagged with the arrow tag to be shot of out vanilla weapons,
2, if you want to render the item (inground) as a arrow replace its rendering function with:
Just add a custom model, then replace everything with this^
this renders a normal arrow model, with your texture, meaning you do not need to rescale anything.
Ok so I'm trying to do this for 1.16.5 and I keep getting these errors, I would appreciate any help, hope you all have a great day/night.
MCreator Crash#2 - Pastebin.com
Here is the code for those who know how to fix this.
MCreator Iron Bow Renderer.java - Pastebin.com
So I did everything the same except for my mod and it shoots a regular arrow and uses the custom arrow. Idk what to do.
@Mindthemoods The item Json file doesn't match the one in the image, the closest is the Java file, this is in 2023.4 however