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

Unset fields in raider entity sub-predicate match against false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.5 Pre-Release 2
    • None
    • Unconfirmed
    • (Unassigned)

      If a field is not set in the raider entity sub-predicate, the game will check if that field is false. For example, if is_captain is not set, only non-captains will be matched.

      To reproduce, enable the attached datapack containing the tis:not_in_raid predicate.

      {
        "condition": "minecraft:entity_properties",
        "entity": "this",
        "predicate": {
          "type": "#minecraft:raiders",
          "type_specific": {
            "type": "minecraft:raider",
            "has_raid": false
          }
        }
      } 

      Then go to a pillager outpost, find a captain and non-captain pillager, and run the following command:

      /effect give @e[distance=..24,predicate=tis:not_in_raid] minecraft:glowing 10 0 true 

      The expected behavior is that both the captain and non-captain will glow, but only the non-captain glows.

        1. 2024-04-15_19.01.38.png
          1.51 MB
          Tis_awesomeness

            Unassigned Unassigned
            Tis_awesomeness Tis_awesomeness
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: