The Bug
A player can still earn advancements in spectator mode, and they are still broadcast to the server. You can test this by going into spectator mode, and /giving yourself an elytra.
Steps to Reproduce
Revoke all advancements from yourself.
/advancement revoke @s everythingSwitch into spectator mode and give yourself a lava bucket.
/give @s minecraft:lava_bucketTake note as to whether or not you are granted the "Hot Stuff" advancement.
Observed Behavior
Players are able to earn advancements whilst in spectator mode.
Expected Behavior
Players would not be able to earn advancements whilst in spectator mode.
Code analysis
Code analysis by @unknown can be found on this comment.
Linked issues
is duplicated by 1
Attachments
Comments 32
I've reproduced inventory advancements (e.g. get a lava bucket) and location advancements (e.g. find a nether fortress). I could not reproduce "enter block" advancements (e.g. enter an end gateway). Starting to breed animals then entering spectator mode also provides the advancement.
Recipes are also unlocked when their advancement is triggered.
I could not reproduce "enter block" advancements (e.g. enter an end gateway).
@unknown check MC-46421.
Alright, just now I did a more thorough check to see which advancement triggers can be activated by players in spectator mode. I did this by creating an advancement with one criteria, a single trigger of each name with no additional conditions (unless they were required (recipe_unlocked)). The results:
Can be triggered by spectators:
bred_animals(breed, then switch gamemodes)changed_dimension(by teleporting across)cured_zombie_villager(feed, then switch gamemodes)effects_changedentity_hurt_player(via/kill)inventory_changedlevitationlocationplayer_hurt_entity(ignite TNT, then switch gamemodes)player_killed_entityrecipe_unlockednether_travel(enter portal, switch gamemodes, teleport across)summoned_entity(ender dragon)tick
Cannot be triggered by spectators, either because the action is impossible (such as taming an animal) or it simply doesn't trigger (such as entering a block):
brewed_potionconstruct_beaconconsume_itemenchanted_itementer_blockentity_killed_playerimpossible😉item_durability_changedplaced_blockslept_in_bedtame_animalused_ender_eyeused_totemvillager_trade
Might want to put that this issue relates to MC-46421, because if that is fixed, then it will be affected by this bug.
Can confirm for MC 1.12.1.