Jump to content

Recommended Posts

Posted (edited)

I used an OBJ model in my mod to render a block. While it renders ok, I can't get it to render when being hold or when in inventory. I have tried registering it in many ways but it still doesn't work. The item in hand appears as purple/black cube and in inventory as a 2d purple/black texture. (There is no error in console):
 

ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString()+".obj", "inventory"));
ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString()+".obj"));
ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString()+".obj", "normal"));
ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString(), "inventory"));
ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString()));
ModelLoader.setCustomModelResourceLocation(ItemSnail, 0, new ModelResourceLocation(ItemSnail.getRegistryName().toString(), "normal"));

(I am not into blockstates that much)

 

Here is my JSON file in blockstates:
 

Spoiler

{
    "forge_marker": 1,
    "defaults": {
        "textures": {"#sn": "mymodname:entity/other/snail"},
        "model": "mymodname:snail.obj"
    },
    "variants": {
        "normal": [{}],
        "inventory": [{
            "transform": {
                "thirdperson": {
                    "translation": [0, 0.09375, -0.171875],
                    "rotation": [ { "y": -45}, {"x": 0}, {"z": 170} ],
                    "scale": 0.375
                },
                "gui": {
                    "rotation": [ {"y": 90} ]
                }
            }
        }],
        "facing": {
            "down": { "model": "mymodname:snail.obj"},
            "up": { "model": "mymodname:snail.obj"},
            "north": { "model": "mymodnamet:snail.obj", "y": -180},
            "south": { "model": "mymodname:snail.obj", "y": 0},
            "west": { "model": "mymodname:snail.obj", "y": 90},
            "east": { "model": "mymodname:snail.obj", "y": 270}
        }
    }
}

 


 

What am I doing wrong?

Edited by GeorgeTsak
Added some info

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



×
×
  • Create New...

Important Information

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