I want CompoundBowItem to be able to shoot only CompoundArrowEntity.
Everything works but CompoundArrowEntity does not have custom texture.
public class CompoundArrowItem extends ArrowItem {
public CompoundArrowItem(Properties builder) {
super(builder);
}
@Override
public AbstractArrowEntity createArrow(World worldIn, ItemStack stack, LivingEntity shooter) {
return new CompoundArrowEntity(worldIn, shooter);
}
}
public class CompoundBowItem extends BowItem {
public CompoundBowItem(Properties builder) {
super(builder);
}
@Override
public Predicate<ItemStack> getInventoryAmmoPredicate() {
return getAmmoPredicate();
}
@Override
public Predicate<ItemStack> getAmmoPredicate() {
return itemStack -> itemStack.getItem() instanceof CompoundArrowItem;
}
}
public class CompoundArrowEntity extends ArrowEntity {
public CompoundArrowEntity(EntityType<? extends CompoundArrowEntity> p_i50172_1_, World p_i50172_2_) {
super(p_i50172_1_, p_i50172_2_);
}
public CompoundArrowEntity(World worldIn, double x, double y, double z) {
super(worldIn, x, y, z);
}
public CompoundArrowEntity(World worldIn, LivingEntity shooter) {
super(worldIn, shooter);
}
@Override
protected ItemStack getArrowStack() {
return new ItemStack(Items.COMPOUND_ARROW.get());
}
}
public class CompoundArrowRenderer extends ArrowRenderer<CompoundArrowEntity> {
private static final ResourceLocation COMPOUND_ARROW_TEXTURE = new ResourceLocation(ExampleMod.ID, "textures/entity/projectiles/compound_arrow.png");
public CompoundArrowRenderer(EntityRendererManager renderManagerIn) {
super(renderManagerIn);
}
@Override
public ResourceLocation getEntityTexture(CompoundArrowEntity entity) {
return COMPOUND_ARROW_TEXTURE;
}
}
textures/entity/projectiles/compound_arrow.png is just recolored version of minecraft/textures/entity/projectiles/arrow.png yet it has minecraft arrow texture.