{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:lapis_lazuli",
          "functions": [
            {
              "function": "minecraft:set_custom_data",
              "tag": "{noswap:tag}"
            },
            {
              "function": "minecraft:set_name",
              "entity": "this",
              "name": {
                "text": "Swapper Heart",
                "italic": false
              },
              "target": "item_name"
            },
            {
              "function": "minecraft:set_lore",
              "entity": "this",
              "lore": [
                {
                  "text": "Swap Immunity from attacks",
                  "color": "gray",
                  "italic": false
                },
                {
                  "text": "Triggers a swap when damaging with arrows",
                  "color": "gray",
                  "italic": false
                }
              ],
              "mode": "append"
            },
            {
              "function": "minecraft:set_components",
              "components": {
                "minecraft:rarity": "rare"
              }
            }
          ],
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "entity": "this",
              "predicate": {
                "nbt": "{Tags:[armored]}"
              }
            }
          ]
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:lapis_lazuli",
          "functions": [
            {
              "function": "minecraft:set_custom_data",
              "tag": "{noswap:tag}"
            },
            {
              "function": "minecraft:set_name",
              "entity": "this",
              "name": {
                "text": "Swapper Heart",
                "italic": false
              },
              "target": "item_name"
            },
            {
              "function": "minecraft:set_lore",
              "entity": "this",
              "lore": [
                {
                  "text": "Swap Immunity from attacks",
                  "color": "gray",
                  "italic": false
                },
                {
                  "text": "Triggers a swap when damaging with arrows",
                  "color": "gray",
                  "italic": false
                }
              ],
              "mode": "append"
            },
            {
              "function": "minecraft:set_components",
              "components": {
                "minecraft:rarity": "rare"
              }
            }
          ],
          "conditions": [
            {
              "condition": "minecraft:random_chance",
              "chance": 0.15
            },
            {
              "condition": "minecraft:entity_properties",
              "entity": "attacking_player",
              "predicate": {
                "nbt": "{Inventory:[{components:{\"minecraft:custom_data\":{luck:\"tag\"}}}]}"
              }
            },
            {
              "condition": "minecraft:inverted",
              "term": {
                "condition": "minecraft:entity_properties",
                "entity": "this",
                "predicate": {
                  "nbt": "{Tags:[armored]}"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}