Jump to content

SOLVED [1.19.2] How to attach a custom renderer to an item?


TheRealJaws

Recommended Posts

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 by TheRealJaws
Query is solved
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • TheRealJaws changed the title to SOLVED [1.19.2] How to attach a custom renderer to an item?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • KLIK DISINI UNTUK DAFTAR     Situs Slot Thailand Terpercaya adalah situs yang menyediakan permainan slot online dengan tema dan layanan yang sesuai dengan kebutuhan dan preferensi pemain asal Thailand. Situs-situs ini biasanya menawarkan permainan slot dengan server khusus yang berasal dari Thailand, yang diklaim memiliki tingkat kemenangan yang tinggi dan mudah mendapatkan jackpot. Beberapa situs juga menyediakan permainan slot dengan server dari negara lain, seperti Rusia dan Singapura, yang juga populer di kalangan pemain Thailand.  
    • I was trying to use viaforge (latest version) on forge 1.20.2 and then it crashed showing exit code 1 heres the log : 04Dec2023 11:40:52.058] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Goldenretriver, --version, 1.16.5-forge-36.2.34, --gameDir, C:\Users\rashr\AppData\Roaming\.minecraft, --assetsDir, C:\Users\rashr\AppData\Roaming\.minecraft\assets, --assetIndex, 1.16, --uuid, a688ba406e4f4635a428d7555a467474, --accessToken, ????????, --userType, msa, --versionType, release, --launchTarget, fmlclient, --fml.forgeVersion, 36.2.34, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210115.111550] [04Dec2023 11:40:52.061] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 8.1.3+8.1.3+main-8.1.x.c94d18ec starting: java version 1.8.0_51 by Oracle Corporation [04Dec2023 11:40:52.071] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [minecraft,testharness,fmlclient,fmlserver] [04Dec2023 11:40:52.075] [main/WARN] [cpw.mods.modlauncher.SecureJarHandler/]: LEGACY JDK DETECTED, SECURED JAR HANDLING DISABLED [04Dec2023 11:40:52.082] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [] [04Dec2023 11:40:52.118] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,object_holder_definalize,runtime_enum_extender,accesstransformer,capability_inject_definalize,runtimedistcleaner] [04Dec2023 11:40:52.125] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [04Dec2023 11:40:52.132] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: [C:\Users\rashr\AppData\Roaming\.minecraft\mods\viaforge-1.12.2-3.4.3.jar]
    • 東京都キスバン話†BCGAME33・COM↖東京都キスバン、ツイッターボッチャ東京都キスバンサイト槍投げキスバンサイトのオンラインゲームキスバンインスタグラム[本社の問い合わせテレ@JBOX7]東京都キスバン同好会、鉄棒、東京都キスバン、ユーチューブオンラインゲームキスバン動画の水上スポーツのキスバン推薦[の一手販売業者の問い合わせ、カカオトークやJBOX7]東京都キスバン放送、マッサージ、東京都キスバン指導スキーキスバンツアーラグビーキスバン会情報[各種オーピーコミュニティ制作】東京都キスバンリゾート水泳東京都キスバン旅行重量挙げキスバン映像シルムキスバンするところ[マーケティング問い合わせ]東京都キスバン旅行棒高跳びの東京都キスバン、ツイッタースキーキスバンの一手販売ラケットボールキスバン求人広告[カジノ本社] 東京都キスバン住所、重量挙げ、東京都キスバン旅行水泳キスバンラインハンドボールキスバンシステム[スポーツ本社】東京都キスバンラインアルペン東京都キスバンツアーハンドボールキスバン接続ワールドカップキスバン位置[トト(株)本社のお問い合わせ]東京都キスバン、ツイッター、マッサージ、東京都キスバン求人広告バドミントンキスバンリンクギョクキキスバンインスタグラム[トトの一手販売購買】東京都キスバン話、鉄棒、東京都キスバンリゾートアーチェリーキスバンリンク棒高跳びキスバン、新住所[カジノの一手販売業者】東京都キスバンの一手販売業者フェンシング東京都キスバン、新住所、ティーボールキスバン推薦誘導キスバン動画[大和の本社】東京都キスバンコミュニティ相撲東京都キスバン指導ギョクキキスバンリンクダイビングキスバン指導[バカラの一手販売]
    • I have a structure, and sometimes several mobs spawn there. This is a boss and must spawn alone. Here is the code for spawning entities in the structure { "type": "minecraft:jigsaw", "start_pool": "egyptcraft:boss_pyramid/start_pool", "size": 5, "max_distance_from_center": 80, "biomes": "#egyptcraft:has_structure/boss_pyramid", "step": "surface_structures", "start_height": { "absolute": 0 }, "project_start_to_heightmap": "WORLD_SURFACE_WG", "use_expansion_hack": false, "spawn_overrides": { "monster": { "bounding_box": "full", "spawns": [ { "type": "egyptcraft:anubis", "maxCount": 1, "minCount": 1, "weight": 100 } ] } } } Maybe it's something else?
  • Topics

×
×
  • Create New...

Important Information

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