-
Bug
-
Resolution: Unresolved
-
None
-
1.16.5, 21w06a, 21w07a, 21w08a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17 Release Candidate 2, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, 1.17.1, 21w37a, 21w39a, 21w40a, 21w43a, 1.18, 1.18.1, 22w05a, 1.18.2 Pre-release 1, 1.18.2, 1.19, 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.21 Pre-Release 1, 1.21, 1.21.3
-
Confirmed
-
Spectator
-
Rendering
-
Normal
-
Platform
The Bug:
The carved pumpkin overlay is rendered in spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head by using the command provided below.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch to spectator mode.
- Take note as to whether or not the carved pumpkin overlay is rendered in spectator mode.
Observed Behavior:
The carved pumpkin overlay is rendered.
Expected Behavior:
The carved pumpkin overlay would not be rendered.
Code Analysis:
Code analysis by Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
public class Gui extends GuiComponent { ... public void render(PoseStack poseStack, float v) { ... if (this.minecraft.options.getCameraType().isFirstPerson()) { if (this.minecraft.player.isScoping()) { this.renderSpyglassOverlay(this.scopeScale); } else { ... ItemStack itemstack = this.minecraft.player.getInventory().getArmor(3); if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem())) { this.renderTextureOverlay(PUMPKIN_BLUR_LOCATION, 1.0F); } } } ...
If we look at the above class, we can see that there are two checks that are carried out before allowing the carved pumpkin overlay to render. One of these checks is to see if the player is in first person and the other is to check if the player has a carved pumpkin on their head. If both of these requirements are met, the carved pumpkin overlay is rendered. The game doesn't check if the player is in spectator mode before allowing the carved pumpkin overlay to render, therefore resulting in this problem occurring.
Fix:
Simply altering the appropriate existing "if" statement within this piece of code to check if the player is in spectator mode before allowing the carved pumpkin overlay to render will resolve this problem.
if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))
if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()) && !this.minecraft.player.isSpectator())
- relates to
-
MC-215534 Spectating a mob with a shader whilst having a carved pumpkin equipped turns the screen completely white
- Resolved
-
MC-215530 The freezing effect isn't immediately removed upon switching into spectator mode
- Open
-
MC-217095 Switching to spectator mode while standing in a nether portal does not make the overlay animation disappear immediately
- Open
-
MC-217716 The green nausea overlay isn't removed when switching into spectator mode
- Open