Posted January 2, 20232 yr Hi there, I've been trying to figure this out but no luck so far, how do I attach a custom renderer to an item in 1.19? Do I need to do it indirectly by attaching an entity to the item and rendering that instead or something? I won't be able to accomplish what I want to do in the render with a .json model. Thanks Edited January 2, 20232 yr by TheRealJaws Query is solved
January 2, 20232 yr https://forge.gemwire.uk/wiki/BlockEntityWithoutLevelRenderer Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
January 2, 20232 yr Author Just now, warjort said: https://forge.gemwire.uk/wiki/BlockEntityWithoutLevelRenderer Thanks, yeah this should work, where should I create the instance for this, just in my main class?
January 2, 20232 yr Author So I need a line like this correct? itemRenderer = new ItemRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(),Minecraft.getInstance().getEntityModels()); and then a model with is isCustomRenderer set to true, with @Override public void initializeClient(Consumer<IClientItemExtensions> consumer) { consumer.accept(new IClientItemExtensions() { @Override public @Nullable Font getFont(ItemStack stack, FontContext context) { return IClientItemExtensions.super.getFont(stack, context); } @Override public BlockEntityWithoutLevelRenderer getCustomRenderer() { return workoutmc.itemRenderer; } }); on my item, and then where do I attach the model to the item?
January 2, 20232 yr There's over a thousand examples on github. Find one that is up-to-date and suites your taste and what you are trying to do. https://github.com/search?l=Java&q=BlockEntityWithoutLevelRenderer&type=Code Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
January 2, 20232 yr Author 8 minutes ago, warjort said: There's over a thousand examples on github. Find one that is up-to-date and suites your taste and what you are trying to do. https://github.com/search?l=Java&q=BlockEntityWithoutLevelRenderer&type=Code Thanks for the help! Didn't know I could search github in this way, thats a huge help
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.