Posted June 11, 20205 yr Having some issues with rendering my new Arrow entity. It uses my ammo fine but it doesn't actually seem to fire as nothing is rendered and mobs don't take damage. My Custom Arrow https://github.com/AzureDoom/Doom-Crucible/blob/master/src/main/java/mod/azure/doomweapon/item/ammo/ShellAmmo.java It's Entity https://github.com/AzureDoom/Doom-Crucible/blob/master/src/main/java/mod/azure/doomweapon/entity/ShotgunShellEntity.java It's Render https://github.com/AzureDoom/Doom-Crucible/blob/master/src/main/java/mod/azure/doomweapon/client/render/ShotgunShellRender.java How I am registering it https://github.com/AzureDoom/Doom-Crucible/blob/master/src/main/java/mod/azure/doomweapon/util/ModEntityTypes.java How I register my Entity Rendering Handler https://github.com/AzureDoom/Doom-Crucible/blob/master/src/main/java/mod/azure/doomweapon/client/ClientModEventSubscriber.java Edited June 14, 20205 yr by AzureZhen
June 14, 20205 yr Author 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?
June 14, 20205 yr Author 5 hours ago, diesieben07 said: Do not use @DistOnly What is the correct thing to use thing? I don't see any issues with it and it's what Vanilla is using. 5 hours ago, diesieben07 said: All your constructors must call a super constructor and pass your EntityType. You have one of them that does not do that. Yup, that fixed it. Changed my ArgentBoltEntity to extend AbstractArrowEntity and did public ArgentBoltEntity(EntityType<?> type, World world) { super((EntityType<? extends AbstractArrowEntity>) type, world); this.referenceItem = null; } Did a few other changes I found from another post here and now it's using the correct Entity when firing!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.