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

I want load a custom obj file and I'm a bit lost.

First of all I want assert that my knowledge is right
assets->modid->blockstates has a json file which name match with a block id and specifies what model must show

Spoiler

{
    "variants": {
        "facing=north": { "model": "modid:block/block_1" },
        "facing=south": { "model": "modid:block/block_2" }
    }
}

"modid:block/block_1" and "modid:block/block_2" must to be registered

assets->modid->models->block has a json file which match with a block id and specifies the elements and textures 

Spoiler

Example default lever


{
    "ambientocclusion": false,
    "textures": {
        "particle": "block/cobblestone",
        "base": "block/cobblestone",
        "lever": "block/lever"
    },
    "elements": [
        {   "from": [ 5, 0, 4 ],
            "to": [ 11, 3, 12 ],
            "faces": {
                "down":  { "uv": [ 5, 4, 11, 12 ], "texture": "#base", "cullface": "down" },
                "up":    { "uv": [ 5, 4, 11, 12 ], "texture": "#base" },
                "north": { "uv": [ 5, 0, 11,  3 ], "texture": "#base" },
                "south": { "uv": [ 5, 0, 11,  3 ], "texture": "#base" },
                "west":  { "uv": [ 4, 0, 12,  3 ], "texture": "#base" },
                "east":  { "uv": [ 4, 0, 12,  3 ], "texture": "#base" }
            }
        },
        {   "from": [ 7, 1, 7 ],
            "to": [ 9, 11, 9 ],
            "rotation": { "origin": [ 8, 1, 8 ], "axis": "x", "angle": -45 },
            "faces": {
                "up":    { "uv": [ 7, 6, 9,  8 ], "texture": "#lever" },
                "north": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "south": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "west":  { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "east":  { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }
            }
        }
    ]
}

Should I use a obj file as element? or instead a json file use a obj file?

 

I have read that obj files must be registered with "OBJLoader.addDomain" but it's from 1.12 version, eclipse doesn't find that class in the dependencies so I think that is despreciated.

Where should I save the obj file?

Must obj file has the same name of a block id?

Must I register the obj file? How?

 

39 minutes ago, Brbcode said:

I want load a custom obj file and I'm a bit lost.

First of all I want assert that my knowledge is right
assets->modid->blockstates has a json file which name match with a block id and specifies what model must show

  Hide contents


{
    "variants": {
        "facing=north": { "model": "modid:block/block_1" },
        "facing=south": { "model": "modid:block/block_2" }
    }
}

"modid:block/block_1" and "modid:block/block_2" must to be registered

assets->modid->models->block has a json file which match with a block id and specifies the elements and textures 

  Hide contents

Example default lever



{
    "ambientocclusion": false,
    "textures": {
        "particle": "block/cobblestone",
        "base": "block/cobblestone",
        "lever": "block/lever"
    },
    "elements": [
        {   "from": [ 5, 0, 4 ],
            "to": [ 11, 3, 12 ],
            "faces": {
                "down":  { "uv": [ 5, 4, 11, 12 ], "texture": "#base", "cullface": "down" },
                "up":    { "uv": [ 5, 4, 11, 12 ], "texture": "#base" },
                "north": { "uv": [ 5, 0, 11,  3 ], "texture": "#base" },
                "south": { "uv": [ 5, 0, 11,  3 ], "texture": "#base" },
                "west":  { "uv": [ 4, 0, 12,  3 ], "texture": "#base" },
                "east":  { "uv": [ 4, 0, 12,  3 ], "texture": "#base" }
            }
        },
        {   "from": [ 7, 1, 7 ],
            "to": [ 9, 11, 9 ],
            "rotation": { "origin": [ 8, 1, 8 ], "axis": "x", "angle": -45 },
            "faces": {
                "up":    { "uv": [ 7, 6, 9,  8 ], "texture": "#lever" },
                "north": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "south": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "west":  { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" },
                "east":  { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }
            }
        }
    ]
}

Should I use a obj file as element? or instead a json file use a obj file?

 

I have read that obj files must be registered with "OBJLoader.addDomain" but it's from 1.12 version, eclipse doesn't find that class in the dependencies so I think that is despreciated.

Where should I save the obj file?

Must obj file has the same name of a block id?

Must I register the obj file? How?

 

I don't know but

    "textures": {
        "particle": "block/cobblestone",
        "base": "block/cobblestone",
        "lever": "block/lever"
    },

"block" should be "blocks" isn't it

If you are using your own texture you add your mod id in front of if

  • Author
19 minutes ago, poopoodice said:

"block" should be "blocks" isn't it

That example is from minecraft files is not mine, and I already use modid:block/texture_name and it works.

Maybe if you change the file path you can give a custom name if you want, sincerely, I didn't try it.

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.