Still having issues with it rendering the vanilla arrow instead of my custom entity. Posting the new code for any help.
AgrentBolt
public class ArgentBolt extends ArrowItem {
public ArgentBolt(Properties properties) {
super(properties);
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
tooltip.add(new StringTextComponent("\u00A7o" + "Powered by Argent. Used for Ballista."));
super.addInformation(stack, worldIn, tooltip, flagIn);
}
@Override
public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.PlayerEntity player) {
int enchant = net.minecraft.enchantment.EnchantmentHelper
.getEnchantmentLevel(net.minecraft.enchantment.Enchantments.INFINITY, bow);
return enchant <= 0 ? false : this instanceof ArgentBolt;
}
@Override
public AbstractArrowEntity createArrow(World worldIn, ItemStack stack, LivingEntity shooter) {
ArgentBoltEntity arrowentity = new ArgentBoltEntity(worldIn, shooter);
return arrowentity;
}
}
ArgentBoltEntity
public class ArgentBoltEntity extends ArrowEntity {
public ArgentBoltEntity(EntityType<? extends ArgentBoltEntity> shooter, World worldIn) {
super(shooter, worldIn);
}
public ArgentBoltEntity(World worldIn, LivingEntity shooter) {
super(worldIn, shooter);
}
public ArgentBoltEntity(World world) {
super(ModEntityTypes.ARGENT_BOLT.get(), world);
}
@SuppressWarnings("unchecked")
public ArgentBoltEntity(World worldIn, EntityType<?> type) {
super((EntityType<? extends ArrowEntity>) type, worldIn);
}
@Override
protected ItemStack getArrowStack() {
return new ItemStack(DoomItems.ARGENT_BOLT.get());
}
@Override
public IPacket<?> createSpawnPacket() {
return NetworkHooks.getEntitySpawningPacket(this);
}
}
ArgentBoltRender
public class ArgentBoltRender extends ArrowRenderer<ArgentBoltEntity> {
private static final ResourceLocation ARGENT_BOLT_TEXTURE = new ResourceLocation(DoomMod.MODID,
"textures/entity/projectiles/argent_bolt.png");
public ArgentBoltRender(EntityRendererManager renderManagerIn) {
super(renderManagerIn);
}
@Override
public ResourceLocation getEntityTexture(ArgentBoltEntity entity) {
return ARGENT_BOLT_TEXTURE;
}
}
It works when I do /summon dooweapon:argent_bolt but when I use the ammo with say a bow, it is still rendering the vanilla arrow. Any thoughts?