Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-208336

'player' sub-predicate of 'entity_properties' predicate only passes if game mode is specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w03a
    • 20w49a
    • None
    • Confirmed
    • (Unassigned)

      The bug

      An entity_properties predicate with the player sub-predicate can only be evaluated as true if the gamemode field is specified, meaning that a predicate testing for a player's experience level, recipes, advancements or statistics will need to test for a game mode as well.
      Likewise, an advancement criterion with the player condition in its legacy form using the player sub-predicate will only be automatically granted if conditions.player.player.gamemode exists and matches the player's game mode.

      How to reproduce

      Create a new creative mode world with the attached data pack. This data pack contains fourteen advancements. The root advancement will be obtained automatically to reveal the advancement tab with all other advancements. Advancements with legacy in the name use conditions.player.player. Advancements with predicate in the name use conditions.player as an array of predicates. Advancements with gamemode in the name test for the player's game mode being creative, while advancements with no_gamemode in the name do not test for game mode.

      • Granting yourself the mojira:foo advancement while in creative mode will grant mojira:advancement_legacy_gamemode and mojira:advancement_predicate_gamemode but will not grant mojira:advancement_legacy_no_gamemode and mojira:advancement_predicate_no_gamemode.
      • Giving yourself at least one level of experience while in creative mode will grant mojira:level_legacy_gamemode and mojira:level_predicate_gamemode but will not grant mojira:level_legacy_no_gamemode and mojira:level_predicate_no_gamemode.
      • Riding on a minecart for ten blocks while in creative mode will grant mojira:stats_legacy_gamemode and mojira:stats_predicate_gamemode but will not grant mojira:stats_legacy_no_gamemode and mojira:stats_predicate_no_gamemode.
      • Unlocking the acacia pressure plate recipe while in creative mode will grant mojira:recipe_legacy_gamemode and mojira:recipe_predicate_gamemode but will not grant mojira:recipe_legacy_no_gamemode and mojira:recipe_predicate_no_gamemode.

            boq [Mojang] Bartosz Bok
            Aeldrion Aeldrion
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: