Posted February 19, 20205 yr I am trying to make an entity which works and renders in a similar fashion to a splash potion. It is defined thus: https://pastebin.com/edkgrnYW To render it, I am using the SpriteRenderer class like so: @EventBusSubscriber(modid = Main.MOD_ID, value = {Dist.CLIENT}, bus = EventBusSubscriber.Bus.MOD) public class ClientProxy { @SubscribeEvent public static void init(FMLClientSetupEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntityExplosivePotion.class, m -> new SpriteRenderer<>(m, Minecraft.getInstance().getItemRenderer())); //RenderingRegistry.registerEntityRenderingHandler(EntitySpicyExplosivePotion.class, RenderSpicyExplosivePotion::new); getItemModelMesher().register(ModItems.EXPLOSIVE_POTION, new ModelResourceLocation("expotions:potion_explosive", "inventory")); getItemModelMesher().register(ModItems.THROWABLE_EXPLOSIVE_POTION, new ModelResourceLocation("expotions:potion_explosive_throwable", "inventory")); getItemModelMesher().register(ModItems.SPICY_EXPLOSIVE_POTION, new ModelResourceLocation("expotions:potion_explosive_spicy", "inventory")); getItemModelMesher().register(ModItems.SPICY_THROWABLE_EXPLOSIVE_POTION, new ModelResourceLocation("expotions:potion_explosive_throwable_spicy", "inventory")); } /** * Convenience function for getting the {@code ItemModelMesher}. * @return The {@code ItemModelMesher} from {@link RenderItem#getItemModelMesher()} via {@link Minecraft#getItemRenderer()} */ public static ItemModelMesher getItemModelMesher() { return Minecraft.getInstance().getItemRenderer().getItemModelMesher(); } } When the entity is spawned it is spawned like so: EntityExplosivePotion potion = new EntityExplosivePotion(player, world); potion.setStrength(getStrength(stack)); potion.setSpicy(spicy); potion.shoot(player, player.rotationPitch, player.rotationYaw, -20.0F, 0.5F, 1.0F); world.addEntity(potion); The problem that I am having is that the entity is not rendering. It functions but no model appears when it is spawned and no output appears in the log either. The event handler for FMLClientSetupEvent is called but the renderer still does not appear to be registered. Here is a copy of my latest.log: https://pastebin.com/ftE0Ffag Edited February 19, 20205 yr by sanman00 My mod: Explosive Potions for 1.10.2
February 19, 20205 yr Going to guess that the entity in question doesn't extend LivingEntity, in which case see or one of the other several threads I found by Googling "forge 1.14 entity renderer". And yeah, ditch that itemModelMesher code like yesterday It's utterly unnecessary.
February 19, 20205 yr Author @desht That thread had the solution, thanks very much! My mod: Explosive Potions for 1.10.2
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.