The Bug
The minecraft:entity.enderman.teleport sound plays at the position the enderman teleports to, which is not the case in 1.8.9, where it also plays at position it teleported from.
Steps to Reproduce
Place down a bucket of water and obtain some enderman spawn eggs.
Summon some endermen in the water by using the spawn eggs and listen closely as you do this.
Observed Behavior
The minecraft:entity.enderman.teleport sound ("Enderman teleports") plays at the position the enderman teleports to.
Expected Behavior
The minecraft:entity.enderman.teleport sound would play at the position the enderman teleports from.
Videos demonstrating the issue
16w03a: https://www.youtube.com/watch?v=m1SPOTMgFGA
1.8.9: https://www.youtube.com/watch?v=W6bX58WABH4
Code Analysis
By @unknown using MCP Reborn 1.16.5 mappings
At net.minecraft.entity.monster.EndermanEntity.teleportTo()
the game simply only tries to play the sound after the enderman teleports:
if (flag && !flag1) {
boolean flag2 = this.attemptTeleport(x, y, z, true);
if (flag2 && !this.isSilent()) {
this.world.playSound((PlayerEntity)null, this.prevPosX, this.prevPosY, this.prevPosZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, this.getSoundCategory(), 1.0F, 1.0F);
this.playSound(SoundEvents.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F);
}
return flag2;
}
Which could be fixed by duplicating the if statement above the teleport attempt as well
if (flag && !flag1) {
if (!this.isSilent()) {
this.world.playSound((PlayerEntity)null, this.prevPosX, this.prevPosY, this.prevPosZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, this.getSoundCategory(), 1.0F, 1.0F);
this.playSound(SoundEvents.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F);
}
boolean flag2 = this.attemptTeleport(x, y, z, true);
if (flag2 && !this.isSilent()) {
this.world.playSound((PlayerEntity)null, this.prevPosX, this.prevPosY, this.prevPosZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, this.getSoundCategory(), 1.0F, 1.0F);
this.playSound(SoundEvents.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F);
}
return flag2;
}
Linked issues
is duplicated by 5
relates to 3
Attachments
Comments 37
@unknown Again, please stop going through tickets and adding confirmation messages for outdated versions.
@unknown Adding this is not helpful for us, please stop immediately. We are more concerned with knowing if it is an issue in the latest full release of the game.
Confirmed for 1.9.