The carved pumpkin overlay is rendered in spectator mode
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 [Mod] 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())
Linked Issues
relates to4
- Unresolved
[Mod] Avoma- 11
- 5
- Confirmed
Normal
- Platform
- Rendering
- Spectator
- game-mode-switch
1.16.5 - 1.21.4
1.16.5 21w06a 21w07a 21w08a 21w08b 21w10a 21w11a 21w13a 21w14a 21w15a 21w16a 21w17a 21w19a 21w20a 1.17-pre1 1.17-pre3 1.17-pre4 1.17-pre5 1.17-rc1 1.17-rc2 1.17 1.17.1-pre1 1.17.1-pre3 1.17.1-rc1 1.17.1 21w37a 21w39a 21w40a 21w43a 1.18 1.18.1 22w05a 1.18.2-pre1 1.18.2 1.19 1.19.2 1.19.3 1.19.4 1.20.1 1.21-pre1 1.21 1.21.3 1.21.4
Created Issue:
Carved pumpkin overlay isn't removed when switching into spectator mode
The Bug:
Carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin.
/item entity @s armor.head replace minecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is not removed upon doing this.
The Bug:
Carved pumpkin overlay isn't removed when switching into spectator mode.Steps to Reproduce:
- Equip a carved pumpkin.
/item entity @s armor.head replace minecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is not removed upon doing this.
The Bug:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin.
/item entity @s armor.head replace minecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is not removed upon doing this.
Carved pumpkin overlay isn't removed when switching into spectator modeThe carved pumpkin overlay isn't removed when switching into spectator mode
The Bug:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin.
/item entity @s armor.headreplaceminecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is not removed upon doing this.
The Bug:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is not removed upon doing this.
The Bug:
The carved pumpkin overlay isn't removed
when switching into spectator mode.Steps to Reproduce:
- Equip a carved pumpkin.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch to spectator mode. (F3+N)
→Notice how the carved pumpkin overlay is
not removed upondoing this.The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- →
Notice how the carved pumpkin overlay isn't removed upon switching into spectator mode.
The carved pumpkin overlay isn't removedwhen switching into spectator modeThe carved pumpkin overlay isn't removed upon switching into spectator mode
The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- →
Notice how the carved pumpkin overlay isn't removed upon switching into spectator mode.
The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- →
Notice how the carved pumpkin overlay isn't removed upon switching into spectator mode.
The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- →
Notice how the carved pumpkin overlay isn't removed upon switching into spectator mode.
Expected Behavior:
The expected behavior would be that the carved pumpkin overlay is removed upon switching into spectator mode.
The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- →
Notice how the carved pumpkin overlay isn't removed upon switching into spectator mode.
Expected Behavior:
The
expected behavior would be that thecarved pumpkin overlayisremoved upon switching into spectator mode.The Bug:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
Observed Behavior:
The carved pumpkin overlay isn't removed upon switching into spectator mode.
Expected Behavior:
The carved pumpkin overlay would be removed upon switching into spectator mode.
The Bug:
The carved pumpkin overlay isn't removed
upon switching into spectator mode.Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
Observed Behavior:
The carved pumpkin overlay isn't removed
upon switching into spectator mode.Expected Behavior:
The carved pumpkin overlay would be removed
upon switching into spectator mode.The Bug:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- Take note as to whether or not the carved pumpkin overlay is removed when switching into spectator mode.
Observed Behavior:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Expected Behavior:
The carved pumpkin overlay would be removed when switching into spectator mode.
The carved pumpkin overlay isn't removedupon switching into spectator modeThe carved pumpkin overlay isn't removed when switching into spectator mode
The Bug:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- Take note as to whether or not the carved pumpkin overlay is removed when switching into spectator mode.
Observed Behavior:
The carved pumpkin overlay isn't removed when switching into spectator mode.
Expected Behavior:
The carved pumpkin overlay would be removed when switching into spectator mode.
Code Analysis:
Code analysis by [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.
net.minecraft.client.gui.Gui.javapublic class Gui extends GuiComponent { ... public void render(PoseStack $ps, float $f) { ... if (this.minecraft.options.getCameraType().isFirstPerson()) { if (this.minecraft.player.isScoping()) { ... } 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 no checks are carried out to see what game mode the player is in before rendering the pumpkin blur. The only checks that are in place are to see whether the player is in first person and if they have a carved pumpkin on their head. This is evident through the following lines of code:
if (this.minecraft.options.getCameraType().isFirstPerson())if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))Potential Fix:
Simply altering an existing "if" statement within this piece of code, or adding a new one altogether that checks what game mode the player is in before rendering the pumpkin blur, should resolve this problem. The following line of code could be used in order to fix this:
!this.minecraft.player.isSpectator()
The Bug:
The carved pumpkin overlay is
n't removed when switching intospectator mode.Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into spectator mode.
- Take note as to whether or not the carved pumpkin overlay is re
moved when switchingintospectator mode.Observed Behavior:
The carved pumpkin overlay is
n't removed when switching into spectator mode.Expected Behavior:
The carved pumpkin overlay would be re
moved when switching into spectator mode.Code Analysis:
Code analysis by [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.1
8.1using MCP-Reborn.net.minecraft.client.gui.Gui.javapublic class Gui extends GuiComponent { ... public void render(PoseStack$ps, float$f) { ... if (this.minecraft.options.getCameraType().isFirstPerson()) {if (this.minecraft.player.isScoping()) {... }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
no checks are carried outto see what game mode the player is in before rendering the pumpkin blur. The only checks that are in place areto seewhetherthe player is in first person andif theyhavea carved pumpkin on their head.This is evident through the following lines of code:if (this.minecraft.options.getCameraType().isFirstPerson())if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))
Potential Fix:Simply altering
anexisting "if" statement within this piece of code, or adding a new one altogether that checks what game modethe player is in beforerendering the pumpkinblur, should resolve this problem. The following line of code could be used in order to fix this:!this.minecraft.player.isSpectator()The Bug:
The carved pumpkin overlay is rendered in spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into 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 [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.client.gui.Gui.javapublic 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.
Current "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))Fixed "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()) && !this.minecraft.player.isSpectator())
The carved pumpkin overlay isn't removed when switching intospectator modeThe carved pumpkin overlay is rendered in spectator mode
The Bug:
The carved pumpkin overlay is rendered in spectator mode.
Steps to Reproduce:
- Equip a carved pumpkin on your head.
/item replace entity @s armor.head with minecraft:carved_pumpkin
- Switch into 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 [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.client.gui.Gui.javapublic 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.
Current "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))Fixed "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()) && !this.minecraft.player.isSpectator())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 into 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 [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.client.gui.Gui.javapublic 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.
Current "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))Fixed "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()) && !this.minecraft.player.isSpectator())
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
into 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 [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.client.gui.Gui.javapublic 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.
Current "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()))Fixed "if" statement:if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem()) && !this.minecraft.player.isSpectator())


Can confirm for 1.16.5
Relates to
MC-216510.