The Meaning of Life, the Universe, and Everything.
Join Date:
5/30/2016
Posts:
57
Member Details
I'm trying to make my first mod, which adds explosive arrows, similar to what Notch does in this video:
I know Java and Eclipse well enough, I just don't know Forge's API. I'm using Forge 1.15.2. If someone could point out the steps that I need to take in my code to accomplish this, as well as give me a rough idea of how I should go about it, that would be awesome. To be clear, I'm not overriding what arrows already do. I want to add a new type of arrow, with its own crafting recipe, texture, and name.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/30/2016
Posts:
57
Member Details
Yeah, I figured that much out.
For the moment I currently have a generic item with the arrow's texture named "Explosive Arrow", and a class that extends the ArrowEntity class. I suppose what I want to do is figure out how to connect the two so I can shoot my arrow like a normal arrow, then add explosions in later.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/30/2016
Posts:
57
Member Details
I didn't make a class for my item. Here's my definition in code:
public static final Item explosive_arrow =
new Item(new Item.Properties().group(ItemGroup.COMBAT))
.setRegistryName(new ResourceLocation(ModProps.MOD_ID, "explosive_arrow"));
I suppose I should make a class that extends Item, shouldn't I?
Edit: I've made a class that extends ArrowItem, and overrode the createArrow method, but I still can't fire my arrow in survival mode. Do I need to register my explosive arrow as an entity?
I'm trying to make my first mod, which adds explosive arrows, similar to what Notch does in this video:
I know Java and Eclipse well enough, I just don't know Forge's API. I'm using Forge 1.15.2. If someone could point out the steps that I need to take in my code to accomplish this, as well as give me a rough idea of how I should go about it, that would be awesome. To be clear, I'm not overriding what arrows already do. I want to add a new type of arrow, with its own crafting recipe, texture, and name.
I'd start with the TippedArrow class, and ArrowEntity class.
Yeah, I figured that much out.
For the moment I currently have a generic item with the arrow's texture named "Explosive Arrow", and a class that extends the ArrowEntity class. I suppose what I want to do is figure out how to connect the two so I can shoot my arrow like a normal arrow, then add explosions in later.
Do you have createArrow() in your ArrowItem class? It should reference your arrow entity in there.
I didn't make a class for my item. Here's my definition in code:
I suppose I should make a class that extends Item, shouldn't I?
Edit: I've made a class that extends ArrowItem, and overrode the createArrow method, but I still can't fire my arrow in survival mode. Do I need to register my explosive arrow as an entity?
In ArrowItem#createArrow:
Use your arrow Entity instead.
I've already been doing that, it's still not working.