Burning entities inside of spawners have incorrect billboarding on the fire effect
The billboarding effect used to render fire doesn't work correctly for rendering mobs inside of a spawner; it's rotated incorrectly and thus the billboard effect fails. This seems to be due to the billboarding not accounting for the rotation of the entity in the spawner.
To reproduce
Create a mob spawner with a flaming zombie by running
/setblock ~ ~ ~ minecraft:spawner{SpawnData:{id:"minecraft:zombie",Fire:12s}}
Then, switch to spectator mode (so that the entity doesn't rotate) and look at the entity. It will sometimes not be facing towards the camera. (It seems to face towards the camera properly when the entity inside is looking in the +Z direction, while it doesn't render at all when it's in the -Z direction and renders skewed when it's slightly +Z with significant X values). To rotate the entity, press F3+N twice to quickly switch out of and back into spectator mode.
This is also visible in other modes, where you can see the fire rotating with the entity instead of facing the camera; however it is much harder to notice the incorrect skewing when it is rotating and the flames from the spawner make it hard to see.
Linked Issues
Created Issue:
Burning entities inside of spawners have incorrect billboarding on the fire effect
The billboarding effect used to render fire doesn't work correctly for rendering mobs inside of a spawner; it's rotated incorrectly and thus the billboard effect fails. This seems to be due to the billboarding not accounting for the rotation of the entity in the spawner.
To reproduce
Create a mob spawner with a flaming zombie by running
The billboarding effect used to render fire doesn't work correctly for rendering mobs inside of a spawner; it's rotated incorrectly and thus the billboard effect fails. This seems to be due to the billboarding not accounting for the rotation of the entity in the spawner.
To reproduce
Create a mob spawner with a flaming zombie by running
The billboarding effect used to render fire doesn't work correctly for rendering mobs inside of a spawner; it's rotated incorrectly and thus the billboard effect fails. This seems to be due to the billboarding not accounting for the rotation of the entity in the spawner.
To reproduce
Create a mob spawner with a flaming zombie by running
/setblock ~ ~ ~ minecraft:spawner{SpawnData:{id:"minecraft:zombie",Fire:12s}}Then, switch to spectator mode (so that the entity doesn't rotate) and look at the entity. It will sometimes not be facing towards the camera. (It seems to face towards the camera properly when the entity inside is looking in the +Z direction, while it doesn't render at all when it's in the -Z direction and renders skewed when it's slightly +Z with significant X values). To rotate the entity, press F3+N twice to quickly switch out of and back into spectator mode.
This is also visible in other modes, where you can see the fire rotating with the entity instead of facing the camera; however it is much harder to notice the incorrect skewing when it is rotating and the flames from the spawner make it hard to see.
discovered while testing
Affects 1.20.3. Shares the same code analysis as MC-138488.
Code analysis: This is caused by spawners using the method MCP calls RenderManager.renderEntity(Entity, double, double, double, float, float, boolean) instead of the one it calls RenderManager.renderEntityStatic(Entity, float, boolean) (n.b. both methods aren't actually static, so that name doesn't make sense; just note that it uses the one that takes a position as parameters instead of the one that computes the position).
However, renderEntityStatic is responsible for handling brightness logic, while renderEntity uses the current brightness. For most entities, this isn't a problem, as their brightness is the exact same as the brightness for the spawner itself. However, a select few entities have custom brightness values, mainly returning max brightness regardless of the current world brightness (they override getBrightnessForRender, which returns two values packed into an int; for reference, 15728880 is 0x00F000F0):
- Blazes
- Magma Cubes
- Vexes
- Withers
- Fireballs (of various types)
- Shulker bullets
- The eye of ender
- XP orbs (notably, these have special logic that factors in current brightness as well)
Additionally, burning entities normally have the light set to max in renderEntityStatic.
Switching over to renderEntityStatic would solve the issue, but messes up the translations needed for spawners to render the entity in the right place. My lazy solution is to simply copy-paste the lighting code into the spawner code before it calls renderEntity, but that's obviously not ideal.
Note that it is fine to call getBrightnessForRender on the entity inside the spawner, as its position is set to the world coordinates of the spawner, so it'll get the same light level as the spawner itself if the entity doesn't override getBrightnessForRender.
Aside #1: The other uses of the renderEntity method (that doesn't set light level) are rendering entities in GUIs, the particle that implements item pickup, the particle that implements the guardian spawn animation, and the code that renders arrows stuck in an entity. For all of those, it does make some sense to use current light values (though for all other than GUIs, it could also probably be switched if the entities had correct positions) and the entities being rendered won't override getBrightnessForRender. Only for spawners does this actually cause problems.
Aside #2: Burning entities inside of a spawner have incorrect billboarding; I've created MC-138860 for that. This behavior is such a small detail that it really doesn't matter too much, but I noticed it during testing.
Also relates to MC-138860


In 20w11a
In 20w12a
Can confirm in 21w05b.
This issue still exists in Minecraft 1.20.1. The updated command is:
/setblock ~ ~ ~ minecraft:spawner{SpawnData:{entity:{id:"minecraft:zombie",Fire:12s}}}Affects 1.20.3