mojira.dev
MC-127970

Using Riptide on a trident with an item in your off-hand causes visual glitch with said item

The bug

18w14a added a new animation when using riptide on a trident, which causes the trident item in your hand to be turned horizontally instead of being held on its side as normal.

However, if you have any item in your offhand, the item in your offhand will also be turned horizontally but will also appear at a very strange position on your screen.

How to reproduce

  1. Obtain a riptide trident and a shield

    /item replace entity @s weapon.mainhand with minecraft:trident{Enchantments:[{id:"riptide",lvl:3}]}
    /item replace entity @s weapon.offhand with minecraft:shield
  2. Ensure that you're in first person, enter some water, and use the riptide enchantment to launch yourself

  3. Look at the shield held in your offhand as you do this, and take note as to whether or not items held in the offhand render in the incorrect position in first person when using a riptide trident
    → ❌ Items held in the offhand render in the incorrect position in first person when using a riptide trident

Expected behavior

Items held in the offhand would not render in the incorrect position in first person when using a riptide trident.

Code analysis

@unknown has done a code analysis in this comment.

Linked issues

MC-128057 Using a Riptide Trident makes the other held item renders weirdly MC-135274 Bugged Visual While Using A Trident With Riptide And Having In The Second Hand The Shield MC-135432 Trident and Shield Glitch MC-136180 Graphical glitch with offhand with riptide trident MC-136343 Shield covers screen while using Riptide III MC-136631 When holding a shield and throwing a trident with riptide 3 in the sea, the trident will turn into the shield and the shield will disappear MC-138545 Problem with offhand items when using riptide MC-139074 Shield bugging MC-149379 Shield on right hand when using a Riptide Trident (1.13 and 1.14 so far) MC-157637 Riptide trident and a shield really reduce visibility MC-157685 Riptide enchanted Trident-Visual Bug MC-159323 Strange riptide with shield MC-164773 Shields obstruct vision when using Riptide MC-164971 You wouldn't see the trident in the trident was enchanted with riptide while holding a shield in first person. MC-170238 Riptide offhand + spin animation MC-182859 using a trident with riptide will display your offhand item on top of the screen MC-183016 Shield blocks view when using riptide trident MC-190335 Bug with trident enchanted on a "riptide" and shield MC-195603 Tridents with the Riptide Enchantment will cause shields in the off-hand to glitch MC-198318 Visual bug with riptide trident with an off hand item. MC-199598 If you use a trident with riptide, and then swap to an other tool it shows the animation of the trident on that tool MC-201362 Off hand Riptide III trident animation issue MC-215965 Trident Shield Visual Bug MC-227472 Incorrect riptide trident working MC-228709 trident's model is misplaced by shield MC-228794 When I use a riptide trident with a shield in my off-hand it glitches. MC-259943 Sheild covers up most of the screen while using Riptide MC-261850 Off-hand item & Riptide Trident MC-268752 shield blocking screen when using riptide trident MC-278974 (machine translation,Regarding the loopholes of the Trident in rapids)激流三叉戟会让干扰其他物品的动作

Attachments

Comments

migrated

It looks quite cool though 🙂.

migrated

Affects 1.13-pre7

Asteraoth

Confirmed for 18w30b

Asteraoth

Confirmed for 18w31a

Asteraoth

Confirmed for 18w32a

Asteraoth

Confirmed for 18w33a

Asteraoth

Confirmed for 1.13.1-pre1

Cavinator1

This bug appears to be fixed in 19w02a, but only because at some stage or another in 1.14's snapshots they removed the animation where when you use the riptide trident, in your hand it no longer goes sideways, hence meaning this bug no longer happens.

Cavinator1

Never mind, forget what I said above, another bug was making the animation not play.

As for this bug, it is confirmed for 19w02a.

ZeNico13

Still in 19w13b and 19w14a

ZeNico13

Still in 19w14b and 1.14 Pre-Release 1

ZeNico13

Still in 1.14 Pre-Release 2

ZeNico13

Still in 1.14 pre-3, 1.14 pre-4 and 1.14 pre-5

Note: it does not affect all items

ZeNico13

Still in 1.14 Release

ZeNico13

Still in 1.14.1 Release

ZeNico13

Still in 1.14.2 Pre-Release 1 and 1.14.2 Pre-Release 2

migrated

Still in the game in 1.14.4 Release

migrated

Yeah found the same thing in 1.14.4, seems to work with many items in off hand like crafting table, golden carrot, bow, bamboo or fishing rod.

migrated

Biggest issue is with shield, because it's just so big. __ It's a little discouraging to use it with trident because it blinds you.

pulpetti

In 20w29a

migrated

This also works the other way round. If you use a riptide trident in your offhand, it causes a visual glitch with the item in the mainhand.

migrated

Still affects 20w48a.

Avoma

Can confirm in 21w07a.

Avoma

Can confirm in 21w08b.

Avoma

Can confirm in 21w16a.

migrated

I thought it was intentional:

If you put the riptide trident in your offhand and put a fire aspect sword on your main hand and kill a mob by holding and releading right click, the mob will be "cooked" with the fire aspect sword even though you didnt left click with it.

So it's like you're using the sword along with the trident.

I might be wrong though

migrated

Yeah, same happens if you got a bow in off hand and a sword in the main hand

migrated

can confirm in 1.17. its also even weirder with a shield

Avoma

I am able to confirm this behavior in 21w41a. Here are some extra details regarding this problem.

The Bug:

Items held in the offhand render in the incorrect position in first person when using a riptide trident.

Steps to Reproduce:

  • Obtain a riptide trident and a shield.

/item replace entity @s weapon.mainhand with minecraft:trident{Enchantments:[{id:"riptide",lvl:3}]}
/item replace entity @s weapon.offhand with minecraft:shield
  • Ensure that you're in first person, enter some water, and use the riptide enchantment to launch yourself.

  • Look at the shield held in your offhand as you do this, and take note as to whether or not items held in the offhand render in the incorrect position in first person when using a riptide trident.

Observed Behavior:

Items held in the offhand render in the incorrect position in first person when using a riptide trident.

Expected Behavior:

Items held in the offhand would not render in the incorrect position in first person when using a riptide trident.

Avoma

Can confirm in 1.18.1.

migrated

Code analysis based on 1.18.1 with yarn mappings.

The rendering of the held items is done by net.minecraft.client.render.item.HeldItemRenderer#renderFirstPersonItem(AbstractClientPlayerEntity, float, float, Hand, float, ItemStack, float, MatrixStack, VertexConsumerProvider, int). This method checks player.isUsingRiptide(), and if that is true, then it applies some transformations to the held item. These transformations are fine for tridents, but don't play nicely with some items, such as shields.

The easiest way to fix this would be to only apply the transformations if the item to render is a trident; that is, replace player.isUsingRiptide() with player.isUsingRiptide() && item.isOf(Items.TRIDENT). This keeps the shield (and any other non-trident item) in the normal place:

[media]
migrated

Could someone make a texture pack that fixes this?

If not, how could I make the pack myself?

Avoma

Can confirm in 1.18.2 and 22w13a.

samswi

Can confirm in 1.19

SeaOfPixels

Can confirm in 23w06a.

SeaOfPixels

Can confirm in 1.19.4pre3

SeaOfPixels

Can confirm in 23w12a

SeaOfPixels

Can confirm in 23w18a.

SeaOfPixels

Can confirm in 1.20 release canidate 1

SeaOfPixels

Can confirm in 1.20.1

SeaOfPixels

Can confirm in 23w31a.

SeaOfPixels

Can confirm in 23w32a.

SeaOfPixels

Can confirm in 1.20.2

SeaOfPixels

Can confirm in 23w40a

SeaOfPixels

In 23w43a.

SeaOfPixels

Can confirm in 23w51a/23w51b

SeaOfPixels

Can confirm in 24w06a, affects wind charges

SeaOfPixels

Confirmed in 24w07a

SeaOfPixels

Confirmed in 1.20.5 pre1

SeaOfPixels

Can confirm in 1.20.5 & 1.20.6-rc1

SeaOfPixels

Best way to fix this is just to make it so the first-person riptide animation only plays for the item being used to riptide. If the trident used to riptide is mainhand, the animation only plays for the mainhand, and vice versa.

Cavinator1

(Unassigned)

Confirmed

Gameplay

Normal

Player Animation

animation, item, off-hand, rendering, riptide, trident

Minecraft 18w14a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 18w16a, Minecraft 18w19b, ..., 1.20.5 Pre-Release 1, 1.20.5, 1.20.6 Release Candidate 1, 24w44a, 1.21.4

Retrieved