Posted January 28, 20214 yr Does anyone have experience working with SpriteRenderer? I've been looking around everywhere for the past few hours on how I could render my item similarly to how snowballs/ender pearls/fireballs do, and I've gotten nowhere. Any help would be greatly appreciated! Entity class: https://pastebin.com/LkZE1qLU Renderer: public class PancakeProjectileRender extends SpriteRenderer<PancakeProjectile> { public PancakeProjectileRender(EntityRendererManager renderManagerIn) { super(renderManagerIn, Minecraft.getInstance().getItemRenderer()); } } Registration: RenderingRegistry.registerEntityRenderingHandler(ModEntities.pancakeProjectileEntity, PancakeProjectileRender::new); Using the above, I can confirm the registration runs (I have it run during the FMLClientSetupEvent), but the entity isn't visible in the world. I can confirm that the entity itself works, as it's still able to move and kill entities, just that it doesn't show a hitbox in F3+B and it doesn't render a texture. Edited January 28, 20214 yr by hammy3502
January 28, 20214 yr You need to override createSpawnPacket in your entity class. Look at this guide for reference: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe81_entity_projectile Also, why did you put this above your entity class? @OnlyIn( value = Dist.CLIENT, _interface = IRendersAsItem.class ) Edited January 28, 20214 yr by Beethoven92 Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
January 28, 20214 yr Author Hello, and thank you for the help! The overriding of createSpawnPacket didn't seem to work, though thank you for catching it before it didn't work in multiplayer! Although I'm using the constructor that actually takes in a shooter (I'm having another item spawn the projectile using it), Forge seems to try to spawn it using the FMLPlayMessages.SpawnEntity spawnEntity, World world constructor, where I can't seem to find the shooter, leading me to believe it had been lost. Would there be any way to recover it, and transfer any other data along with it?
January 28, 20214 yr Post a link to your repository please Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
January 28, 20214 yr Author The repo is currently a bit of a mess, as I'm currently porting over from 1.12 before I focus on cleaning up with how different 1.16 is in comparison 1.12.
January 29, 20214 yr Author Going to open up another thread about the issue I've run into, since the title no longer fits this one
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.