I created a custom bow that uses my modded arrows. It worked with checking for the custom arrows, and even subtracting them from the stack, but on firing the bow, it just shoots a normal MC arrow, and it picks a normal arrow up from the ground.
I figured the only way for it to shoot a new type of arrow was to create new ItemArrow and EntityArrow classes, which I have done. However, now the bow doesn't fire ANY arrow when I shoot it. I'm baffled by why this is the case now. Does anyone know anything about custom bows and arrows?
Here are the pastebins for all three classes used. I'd love to figure out why this isn't working.
Am I not supposed to have this as abstract? EntityArrow is abstract, which means I should have the class extending abstract, too, right?
Also, this should cover the custom entity already, right?
No, your arrow should not be abstract. An abstract class is used when one wants to define default behaviour (methods and/or fields) for its subclasses. EntityArrow is abstract for that purpose. So, make your arrow entity non-abstract and return its instance in "createArrow".
You need to register the arrow entity class by using EntityRegistry#registerModEntity(net.minecraft.util.ResourceLocation, java.lang.Class<? extends net.minecraft.entity.Entity>, java.lang.String, int, java.lang.Object, int, int, boolean) during Preinitialization.If after that the entity is not being rendered properly, also register a rendering handler using RenderingRegistry#registerEntityRenderingHandler (during Preinit., too).