Player gets "Return to Sender" achievement (killing ghast with fireball) even if ghast was not killed
The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal
- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]} - Summon a fireball and punch it towards the ghast
/summon fireball ~ ~ ~ {direction:[0.0,0.0,0.0]}→ You will get the achievement even though the ghast was not killed
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float) always gives the achievement regardless of it the ghast is dead.
/** * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else if ("fireball".equals(source.getDamageType()) && source.getEntity() instanceof EntityPlayer) { // Replaced this // super.attackEntityFrom(source, 1000.0F); // ((EntityPlayer)source.getEntity()).addStat(AchievementList.GHAST); // return true; boolean successfullyAttacked = super.attackEntityFrom(source, 1000.0F); if (successfullyAttacked && !this.isEntityAlive()) { ((EntityPlayer)source.getEntity()).addStat(AchievementList.GHAST); } return successfullyAttacked; } else { return super.attackEntityFrom(source, amount); } }
Created Issue:
Player gets "Return to Sender" achievement (killing ghast with fireball) even if ghast was not killed
The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]}- Switch to Survival mode and reflect a fireball
→ You will get the achievement even though the ghast was not killedCode analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float) does not give the achievement based on if the method net.minecraft.entity.EntityLivingBase.attackEntityFrom(DamageSource, float) returned true. Additionally the method EntityGhast.attackEntityFrom should probably only return true if the parent method successfully damaged the ghast.
The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]}- S
witch to Survival mode and reflect a fireball
→ You will get the achievement even though the ghast was not killedCode analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float) does not give the achievement based on if the method net.minecraft.entity.EntityLivingBase.attackEntityFrom(DamageSource, float) returned true. Additionally the method EntityGhast.attackEntityFrom should probably only return true if the parent method successfully damaged the ghast.
The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]}- Summon a fireball and punch it towards the ghast
/summon fireball ~ ~ ~ {direction:[0.0,0.0,0.0]}→ You will get the achievement even though the ghast was not killed
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float) does not give the achievement based on if the method net.minecraft.entity.EntityLivingBase.attackEntityFrom(DamageSource, float) returned true. Additionally the method EntityGhast.attackEntityFrom should probably only return true if the parent method successfully damaged the ghast.
The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]}- Summon a fireball and punch it towards the ghast
/summon fireball ~ ~ ~ {direction:[0.0,0.0,0.0]}→ You will get the achievement even though the ghast was not killed
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float)
does notgive the achievementbasedonifthemethodnet.minecraft.entity.EntityLivingBase.attackEntityFrom(DamageSource, float) returned true. Additionally the method EntityGhast.attackEntityFrom should probably only return true if the parent method successfully damaged the ghast.The bug
The player gets the "Return to Sender" (achievement.ghast) achievement even if the ghast was not killed. You would expect not to get the achievement because the description of it says "Destroy a Ghast with a fireball".
How to reproduce
- Give yourself all required achievements
/achievement give achievement.portal- Summon a ghast with more than 1000 health, because a fireball reflected by a player does 1000 damage to a ghast
/summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"ghast",Attributes:[{Name:"generic.maxHealth",Base:1000.1}],Health:1000.1f}]}- Summon a fireball and punch it towards the ghast
/summon fireball ~ ~ ~ {direction:[0.0,0.0,0.0]}→ You will get the achievement even though the ghast was not killed
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGhast.attackEntityFrom(DamageSource, float) always gives the achievement regardless of it the ghast is dead.
Suggested fix/** * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else if ("fireball".equals(source.getDamageType()) && source.getEntity() instanceof EntityPlayer) { // Replaced this // super.attackEntityFrom(source, 1000.0F); // ((EntityPlayer)source.getEntity()).addStat(AchievementList.GHAST); // return true; boolean successfullyAttacked = super.attackEntityFrom(source, 1000.0F); if (successfullyAttacked && !this.isEntityAlive()) { ((EntityPlayer)source.getEntity()).addStat(AchievementList.GHAST); } return successfullyAttacked; } else { return super.attackEntityFrom(source, amount); } }
Uhh... is it Invalid , or Cannot Reproduce now that Achievements have been replaced with advancements?
Perhaps disregarded
Might still be the case with advancements; all achievements will be converted, so we have to wait until then to see if this is still the case or fixed.
Marking as invalid since the advancement is created with the minecraft:player_killed_entity and no special trigger.