Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey,

I`m a newbie at Forge modding and I wanted to make my first mod with an first item.

It`s registered and it is displayed all the time with the right name,

but ingame it has only the black-pink texture.

The problem is the item rendering:

 

The json file for my first item is located at assets.scraputils.models.item.lavaingot.json and the content is:

{
"parent": "builtin/generated",
"textures": {
"layer0": "scraputil:items/lavaingot"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

 

The texture layer0 is located at assets.scraputils.textures.item.lavaingot.png

 

My ItemRenderRegisterer looks like this:

package com.Scrap.scraputils.client.render.items;

import com.Scrap.scraputils.Main;
import com.Scrap.scraputils.item.ModItems;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;

public final class ItemRenderRegister {
public static String modid = Main.MODID;
    public static void registerItemRenderer() {
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.LavaIngot, 0, new ModelResourceLocation("scraputils:lavaingot", "inventory"));    
        reg(ModItems.LavaIngot);
    }

    public static void reg(Item item) {
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(modid + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }
}

 

Please help me,

Scrapnix

  • Author

Hey,

at first, thanks to you for your post,

but I made all like you said and nothing changed :(

I don`t know whats wrong in it.

Every tutorial explains other whises to register Models...

Do you know where I can learn mod coding on the right way?

I`ll give my mod a second try and after that we will see...

 

PS: You`re German? If you want to you can add me in Skype or give me your Skype name, because I`m searching for good coders which can help me. Skype: @battlemac182

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.