Jump to content

Delpig

Members
  • Posts

    8
  • Joined

  • Last visited

Delpig's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I change my entity like that this.referenceItem = itemInit.TRAINING_ARROW.get(); And the renderer like that return new ResourceLocation(AlduinMod.MOD_ID + ":textures/entity/projectiles/"+ refItem.getRegistryName().getPath()+ ".png"); And it works fine ! Thank you very much
  2. Ah yes XD Here's my renderer, the line "refitem.getRegistryName().getPath()" return "air" not the name of the file.. But if i replace this by my file name, it works. Where is set the "path" attribute ? 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/projectiles/"+ refItem.getRegistryName().getPath()); } }
  3. Oh okay ! What should i do in that method ? @Override public IPacket<?> createSpawnPacket(){ return NetworkHooks.getEntitySpawningPacket(this); } I did that but my projectile is totally black
  4. Could you explain me this ? "getSpawnpacket" i haven't found it or i'm searching at the wrong place I'm trying to create a custom bow and arrow but my arrow isn't rendering on client.
  5. 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
  6. 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); } }
  7. 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 ?
  8. 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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.