Jump to content

Recommended Posts

Posted

I'm trying to load my custom item model (located at <resourcepack>/assets/tesitems/models/item/iron_sword.json), I am using resource pack for fast reloading, but it doesn't work. I don't see any exceptions, so I think model is getting loaded. Here is model code:

{
    "parent": "tesitems:item/handheld",
    "textures": {
        "layer0": "tesitems:items/iron_sword"
    },
    "display": {
        "thirdperson": {
            "rotation": [ 0, 90, -35 ],
            "translation": [ 0, 1.25, -3.5 ],
            "scale": [ 0.85, 0.85, 0.85 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

, handheld (in the same folder):

{
    "parent": "builtin/generated",
    "display": {
        "thirdperson_righthand": {
            "rotation": [ 0, 90, -35 ],
            "translation": [ 0, 1.25, -3.5 ],
            "scale": [ 0.85, 0.85, 0.85 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ 0, 90, -35 ],
            "translation": [ 0, 1.25, -3.5 ],
            "scale": [ 0.85, 0.85, 0.85 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

, registering:

    private static void registerWeapon(Weapon weapon, String name) {
        weapon.setRegistryName(name);
        weapon.setUnlocalizedName(name);
        GameRegistry.register(weapon);
    }

, Weapon extends ItemSword. Texture is in <resourcepack>/assets/tesitems/textures/items/. What had I missed?

Posted

Mods are already resource packs, you can build your project in your IDE and then reload resources in-game any time you add/change a resource.

 

There are no

thirdperson

or

firstperson

display transformations in 1.9+ (they were split into left/right hand), so your

iron_sword

model is using the transformations specified by your

handheld

model.

 

Minecraft will automatically load a model for each

Item

, but it won't actually use that model unless you tell it to by calling

ModelLoader.setCustomModelResourceLocation

/

setCustomMeshDefinition

in preInit (only on the client side).

 

If that's not the issue, upload your FML log (logs/fml-client-latest.log) to Gist and link it here. It should tell you what went wrong.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.