Posted April 26, 20205 yr Hello, I wanted to create a custom bow and arrow, but I can't get it shot with a classic bow or my custom bow. My arrow extends ArrowItem though... I'll see you around. Delpig
April 26, 20205 yr Author I don't this so... I added my arrow to a registry.. But a tag ? I have something like that { "replace": false, "values": [ "alduinmod:training_arrow" ] } Is that you are meaning ?
April 26, 20205 yr 24 minutes ago, Delpig said: [...] I have something like that { "replace": false, "values": [ "alduinmod:training_arrow" ] } Is that you are meaning ? If this is a json file named "arrows.json" in your "data/minecraft/tags/items" folder, then yes. Make sure this file is in the "minecraft" namespace and not in your modid namespace.
April 26, 20205 yr Author Oh yes you're genius ! my json file were in my modid folder not minecraft folder ! It works now ! But i have and other issue, my arrow isn't rendering when i shoot it, but if i'm making an effect onHit, it work.. so.. If you could know from where it came Here's my render class package com.alduin.alduinmod.client.render; import com.alduin.alduinmod.AlduinMod; import com.alduin.alduinmod.entity.training_arrow.EntityTrainingArrow; import net.minecraft.client.renderer.entity.ArrowRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; public class RenderTrainingArrow extends ArrowRenderer<EntityTrainingArrow> { public RenderTrainingArrow(EntityRendererManager renderManagerIn) { super(renderManagerIn); // TODO Auto-generated constructor stub } @Override public ResourceLocation getEntityTexture(EntityTrainingArrow entity) { Item refItem = entity.getArrowStack().getItem(); return new ResourceLocation(AlduinMod.MOD_ID + ":textures/entity/projectile/"+ refItem.getRegistryName().getPath()); } } And my ClientSideEvent package com.alduin.alduinmod.client; import com.alduin.alduinmod.AlduinMod; import com.alduin.alduinmod.client.render.RenderTrainingArrow; import com.alduin.alduinmod.init.entityTypes; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @EventBusSubscriber(modid = AlduinMod.MOD_ID, bus=EventBusSubscriber.Bus.MOD, value=Dist.CLIENT) public class ClientModEventSubscriber { @SubscribeEvent public static void onClientSetup(final FMLClientSetupEvent event) { RenderingRegistry.registerEntityRenderingHandler(entityTypes.ARROW.get(), RenderTrainingArrow::new); } }
April 26, 20205 yr 15 minutes ago, Delpig said: [...] But i have and other issue, my arrow isn't rendering when i shoot it, but if i'm making an effect onHit, it work.. so.. If you could know from where it came Here's my render class package com.alduin.alduinmod.client.render; import com.alduin.alduinmod.AlduinMod; import com.alduin.alduinmod.entity.training_arrow.EntityTrainingArrow; import net.minecraft.client.renderer.entity.ArrowRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; public class RenderTrainingArrow extends ArrowRenderer<EntityTrainingArrow> { public RenderTrainingArrow(EntityRendererManager renderManagerIn) { super(renderManagerIn); // TODO Auto-generated constructor stub } @Override public ResourceLocation getEntityTexture(EntityTrainingArrow entity) { Item refItem = entity.getArrowStack().getItem(); return new ResourceLocation(AlduinMod.MOD_ID + ":textures/entity/projectile/"+ refItem.getRegistryName().getPath()); } } [...] Make sure your texture file is really in "textures/entity/projectile/" and look for related errors in your console log. (the vanilla arrow texture is in "projectiles" so you should check if you forgot the s) Edited April 26, 20205 yr by Boy132
April 26, 20205 yr Author I added the "s" to my projectile folder but it doesn't change anything, also there isn't any error related in my console when i shoot Maybe it's my projectile png who isn't good. I don't know.. Update: I used this in my entity @Override public IPacket<?> createSpawnPacket(){ return NetworkHooks.getEntitySpawningPacket(this); } This is the new line in my renderer return new ResourceLocation(AlduinMod.MOD_ID + ":textures/entity/projectiles/"+ refItem.getRegistryName().getPath()+ ".png"); And it works fine Edited April 27, 20205 yr by Delpig
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.