The bug
The pig and particles within the minecart spawner is offset from the center of the displayed spawner, showing as rotating about an axis located at a corner of the displayed spawner.
To Reproduce:
RunÂ
/execute align xyz run summon minecraft:spawner_minecart ~0.5 ~1.9 ~ {SpawnData:{entity:{id:"minecraft:bat"}},NoGravity:1b}
Notice the particles are offset.
Code analysis
Code analysis by @unknown can be found in this comment and this comment.
Related issues
is duplicated by
relates to
Attachments
Comments


This is also in regards to the offset mob display...............

There, I changed it so that it is no longer related to the pig displayed instead focused on the offset, which was what I was more intending to address.

Not the same bug as MC-65065, this one addresses the offset.

Confirmed for
1.8.5
1.8.6
The entity has also a shadow (which is unintended, which is also to far down) and the flame particles are centered on the block instead of on the spawner minecart

No entity seems to be displaying at all anymore (15w45a)

Confirmed "fixed".

Not sure if the mob not displaying is a bug or not, but perhaps if it renders again, the mob might still be in the wrong place...but can't tell that for now

Relates to:
The problem for the mob to be offset is that the values for the translate(float p_179109_0_, float p_179109_1_, float p_179109_2_)
method of the /Client/src/net/minecraft/client/renderer/GlStateManager.java
(MCP 1.8 names) need to be offset when called for a mob spawner in the /Client/src/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java
class by the func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_)
method, because apparently setting position and rotation of the entity has no effect. So this "fix" might not actually fix the main problem behind this.
public static void func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_)
{
Entity var8 = p_147517_0_.func_180612_a(p_147517_0_.getSpawnerWorld());
if (var8 != null)
{
float var9 = 0.4375F;
// This would work for spawner blocks
GlStateManager.translate(0.0F, 0.4F, 0.0F);
// This would work for MinecartSpawners
GlStateManager.translate(0.5F, 0.4F, -0.5F);
GlStateManager.rotate((float)(p_147517_0_.func_177223_e() + (p_147517_0_.func_177222_d() - p_147517_0_.func_177223_e()) * (double)p_147517_7_) * 10.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -0.4F, 0.0F);
GlStateManager.scale(var9, var9, var9);
var8.setLocationAndAngles(p_147517_1_, p_147517_3_, p_147517_5_, 0.0F, 0.0F);
Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(var8, 0.0D, 0.0D, 0.0D, 0.0F, p_147517_7_);
}
}

The reason why the particles are always at a block position is that this is done by the updateSpawner()
method of the net.minecraft.tileentity.MobSpawnerBaseLogic
class. However as position it takes a BlockPos
. This works for the spawner block, but not for the minecart.
public void updateSpawner()
{
if (this.isActivated())
{
BlockPos var1 = this.func_177221_b();
double var6;
if (this.getSpawnerWorld().isRemote)
{
double var2 = (double)((float)var1.getX() + this.getSpawnerWorld().rand.nextFloat());
double var4 = (double)((float)var1.getY() + this.getSpawnerWorld().rand.nextFloat());
var6 = (double)((float)var1.getZ() + this.getSpawnerWorld().rand.nextFloat());
this.getSpawnerWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, var2, var4, var6, 0.0D, 0.0D, 0.0D, new int[0]);
this.getSpawnerWorld().spawnParticle(EnumParticleTypes.FLAME, var2, var4, var6, 0.0D, 0.0D, 0.0D, new int[0]);
//...
}
//...
}
}

Could you please include the second comment as well?
Confirmed for
15w50a The particles are still offset

Done. Read over that last comment, you forgot to put class and method name 😉

Whoops you are right, thank you for that 🙂
And could you please reopen the report?

Reopened. Please explicitly ask for reports to be reopened in the future. When we see "confirmed for X" we just add the new affected version.

Confirmed for 1.10-pre1.

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.
This is an automated comment on any open or reopened issue with out-of-date affected versions.

Affects 1.13 and 18w31a

Seems fixed in pre4, can anyone confirm?

It's not fixed in 1.15-pre4.

It was definitely fixed for me, weird

I'm staring right at it and it's not fixed
I updated the report with an example command to demonstrate.

@@unknown, there is sadly a Jira bug which can cause links to get removed when switching between visual and text editor and editing in both (if I recall correctly). This happened with the links of the report, I re-added them now. Please be careful when switching the editor modes.

20w06a affected

Affects 1.16.1

Affects 20w45a

In 20w49a
Â
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a. Video attached.
Can confirm in 21w11a.
Can confirm in 21w14a.
Can confirm in 21w17a.

Affects 1.17
Can confirm in 1.17.1.
Can confirm in 1.18.1.
Can confirm in 1.18.2.
Can confirm in 1.19.

Can confirm in 1.19.1-pre2.
Can confirm in 1.19.2.

Can confirm in 1.19.3 and 23w06a