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

2020-06-15_20_13_43.thumb.png.04fdea5e8e35bda32876f2b8ccedbc25.png

 

For some reason, my custom weapon texture goes above the screen whenever I'm reloading. Is there any particular cause for this happening? I've even tried using the crossbow JSON values and texture like in the image above but it still does this.

I don't think it's my code that is causing this kind of issue, but will post it if necessary.
This issue only happens in first person view, the third person appearance is totally fine.

Edited by CrackedScreen

It would be nice if you can post the json file of the weapon and include if you made any changes to the first person renderer. If you really want to you could import the model into Blockbench and look at the first person display to see if the issue is in your json file or not.

  • Author
{
    "parent": "item/generated",
    "textures": {
        "layer0": "rifles:item/rifle"
    },
    "display": {
        "thirdperson_righthand": {
            "rotation": [ -80, 260, -40 ],
            "translation": [ -1, 0, 2.5 ],
            "scale": [ 0.9, 0.9, 0.9 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ -80, -280, 40 ],
            "translation": [ -1, -2, 2.5 ],
            "scale": [ 0.9, 0.9, 0.9 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, -90, 25 ],
            "translation": [ 1.13, 3.2, 1.13],
            "scale": [ 0.68, 0.68, 0.68 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, 90, -25 ],
            "translation": [ 1.13, 3.2, 1.13],
            "scale": [ 0.68, 0.68, 0.68 ]
        }
    },
    "overrides": [
        {
            "predicate": {
                "reloading": 1,
                "reloaded": 1.0
            },
            "model": "item/crossbow_pulling_2"
        },
        {
            "predicate": {
                "loaded": 1
            },
            "model": "item/crossbow_arrow"
        }
    ]
}

 

Here's the JSON, I'm aware that the reloaded/reload finish states point to the crossbow textures but this is just debug.

  • Author

It doesn't extend CrossbowItem, but has this:

public UseAction getUseAction(ItemStack stack) {
    return UseAction.CROSSBOW;
}

I wasn't personally aware that crossbow had special handling by the render class, but this method might be enough to cause this issue.

Is there any way I can work around this?

That would make sense as the method has an effect on the PlayerRenderer which in turn affects the FirstPersonRenderer. As for a way around this, you would have to update the MatrixStack when your item is held during RenderHandEvent. In that case, you could repurpose the CrossbowItem rendering by canceling the event and rendering the item yourself in the correct location.

  • Author

Thanks for helping, I'll be sure to take a look in the PlayerRenderer class. It might be better for me to use something else for the time being since I have other priorities. I'll mark this as solved.

Edited by CrackedScreen

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.