{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "pr:dimetro",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:pig_baby": {
        "minecraft:is_baby": {},
        "minecraft:scale_by_age": {
          "start_scale": 0.1,
          "end_scale": 0.83
        },
        "minecraft:ageable": {
          "duration": 1200,
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          },
          "feed_items": [
            "pr:growth_syringe"
          ]
        },
        "minecraft:behavior.follow_parent": {
          "priority": 6,
          "speed_multiplier": 1.1
        },
        "minecraft:health": {
          "value": 40,
          "max": 40
        },
        "minecraft:type_family": {
          "family": [
            "dimetro",
            "babydimet"
          ]
        }
      },
      "minecraft:pig_adult": {
        "minecraft:experience_reward": {
          "on_bred": "math.random(1,7)",
          "on_death": "query.last_hit_by_player?math.random(1,3):0"
        },
        "minecraft:behavior.breed": {
          "priority": 4,
          "speed_multiplier": 1
        },
        "minecraft:breedable": {
          "requireTame": false,
          "breedsWith": [
            {
              "mateType": "pr:dimetro",
              "babyType": "pr:egg_dimetro",
              "breed_event": {
                "event": "minecraft:entity_born",
                "target": "baby"
              }
            }
          ],
          "breedItems": [
            "beef",
            "chicken",
            "clownfish",
            "cooked_beef",
            "fish",
            "muttonraw",
            "porkchop",
            "pr:paleomeat",
            "pr:paleosteak",
            "rabbit",
            "beef",
            "chicken",
            "clownfish",
            "cooked_beef",
            "fish",
            "muttonraw",
            "porkchop",
            "pr:paleomeat",
            "pr:paleosteak",
            "rabbit"
          ]
        },
        "minecraft:health": {
          "value": 40,
          "max": 40
        },
        "minecraft:type_family": {
          "family": [
            "dimetro"
          ]
        }
      },
      "pr:tamed": {
        "minecraft:sittable": {},
        "minecraft:interact": {
          "interactions": [
            {
              "use_item": true,
              "transform_to_item": "pr:dimetrotp",
              "swing": false,
              "interact_text": "Scan",
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "domain": "hand",
                      "operator": "==",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "pr:paleopedia"
                    }
                  ]
                }
              }
            },
            {
              "use_item": true,
              "transform_to_item": "pr:paleopedia",
              "swing": false,
              "interact_text": "Close",
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "domain": "hand",
                      "operator": "==",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "pr:dimetrotp"
                    }
                  ]
                }
              }
            },
            {
              "use_item": false,
              "swing": true,
              "interact_text": "Follow",
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "domain": "hand",
                      "operator": "==",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "minecraft:bone"
                    }
                  ]
                },
                "event": "pr:follow",
                "target": "self"
              }
            }
          ]
        }
      },
      "pr:follow": {
        "minecraft:behavior.follow_owner": {
          "priority": 2,
          "can_teleport": true
        },
        "minecraft:interact": {
          "interactions": {
            "use_item": false,
            "swing": true,
            "interact_text": "Free Roam",
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "domain": "hand",
                    "operator": "==",
                    "subject": "other",
                    "test": "has_equipment",
                    "value": "minecraft:bone"
                  }
                ]
              },
              "event": "pr:freeroam",
              "target": "self"
            }
          }
        }
      }
    },
    "components": {
      "minecraft:type_family": {
        "family": [
          "dimetro"
        ]
      },
      "minecraft:nameable": {
        "alwaysShow": false,
        "allowNameTagRenaming": true
      },
      "minecraft:health": {
        "value": 40,
        "max": 40
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": {
              "test": "in_lava",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.2
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": true,
        "avoid_water": true,
        "avoid_damage_blocks": true
      },
      "minecraft:movement.basic": {},
      "minecraft:jump.static": {},
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "height": 2.0,
        "width": 0.9
      },
      "minecraft:leashable": {
        "soft_distance": 4,
        "hard_distance": 6,
        "max_distance": 10
      },
      "minecraft:balloonable": {
        "mass": 0.75
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.mount_pathing": {
        "priority": 1,
        "speed_multiplier": 1.25,
        "target_dist": 0,
        "track_target": true
      },
      "minecraft:behavior.float": {
        "priority": 2
      },
      "minecraft:behavior.tempt": {
        "priority": 5,
        "speed_multiplier": 1.2,
        "items": [
          "beef",
          "chicken",
          "clownfish",
          "cooked_beef",
          "fish",
          "muttonraw",
          "porkchop",
          "pr:paleomeat",
          "pr:paleosteak",
          "rabbit"
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 7,
        "speed_multiplier": 1
      },
      "minecraft:behavior.look_at_player": {
        "priority": 8,
        "look_distance": 6,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 9
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 60 : 0"
      },
      "minecraft:underwater_movement": {
        "value": 0.02
      },
      "minecraft:scale": {
        "value": 0.83
      },
      "minecraft:sittable": {},
      "minecraft:behavior.stay_while_sitting": {
        "priority": 3
      },
      "minecraft:attack": {
        "damage": 6
      },
      "minecraft:behavior.melee_attack": {
        "priority": 2,
        "speed_multiplier": 1.4,
        "target_dist": 0,
        "max_dist": 3,
        "random_stop_interval": 100,
        "track_target": false,
        "reach_multiplier": 1.4
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 3,
        "within_radius": 15,
        "must_reach": true,
        "entity_types": [
          {
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "goat"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "chicken"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "cow"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "donkey"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "pig"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "arthropleura"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "tiktaalik"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "sniffer"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "cod"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "fish"
                }
              ]
            },
            "max_dist": 25.0,
            "must_see": false
          }
        ],
        "must_see": false
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 3
      },
      "minecraft:behavior.owner_hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.owner_hurt_target": {
        "priority": 2
      },
      "minecraft:tameable": {
        "probability": 0.33,
        "tameItems": [
          "beef",
          "chicken",
          "clownfish",
          "cooked_beef",
          "fish",
          "muttonraw",
          "porkchop",
          "pr:paleomeat",
          "pr:paleosteak",
          "rabbit",
          "beef",
          "chicken",
          "clownfish",
          "cooked_beef",
          "fish",
          "muttonraw",
          "porkchop",
          "pr:paleomeat",
          "pr:paleosteak",
          "rabbit"
        ],
        "tame_event": {
          "event": "pr:on_tame",
          "target": "self"
        }
      },
      "minecraft:breedable": {
        "requireTame": false,
        "breedsWith": [
          {
            "mateType": "pr:dimetro",
            "babyType": "pr:egg_dimetro",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          }
        ],
        "breedItems": [
          "beef",
          "chicken",
          "clownfish",
          "cooked_beef",
          "fish",
          "muttonraw",
          "porkchop",
          "pr:paleomeat",
          "pr:paleosteak",
          "rabbit",
          "beef",
          "chicken",
          "clownfish",
          "cooked_beef",
          "fish",
          "muttonraw",
          "porkchop",
          "pr:paleomeat",
          "pr:paleosteak",
          "rabbit"
        ]
      },
      "minecraft:behavior.breed": {
        "priority": 3,
        "speed_multiplier": 1.0
      },
      "minecraft:knockback_resistance": {
        "value": 0.3,
        "max": 0.3
      },
      "minecraft:interact": {
        "interactions": [
          {
            "use_item": true,
            "transform_to_item": "pr:dimetrop",
            "swing": false,
            "interact_text": "Scan",
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "domain": "hand",
                    "operator": "==",
                    "subject": "other",
                    "test": "has_equipment",
                    "value": "pr:paleopedia"
                  }
                ]
              }
            }
          },
          {
            "use_item": true,
            "transform_to_item": "pr:paleopedia",
            "swing": false,
            "interact_text": "Close",
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "domain": "hand",
                    "operator": "==",
                    "subject": "other",
                    "test": "has_equipment",
                    "value": "pr:dimetrop"
                  }
                ]
              }
            }
          }
        ]
      },
      "minecraft:equip_item": {},
      "minecraft:behavior.pickup_items": {
        "can_pickup_any_item": false,
        "can_pickup_to_hand_or_equipment": false,
        "cooldown_after_being_attacked": 20.0,
        "goal_radius": 2.0,
        "max_dist": 3.0,
        "pickup_based_on_chance": false,
        "speed_multiplier": 0.5,
        "track_target": false
      },
      "minecraft:behavior.eat_carried_item": {
        "delay_before_eating": 1,
        "priority": 0
      },
      "minecraft:behavior.equip_item": {
        "priority": 2
      },
      "minecraft:shareables": {
        "all_items": false,
        "all_items_max_amount": 1,
        "items": [
          {
            "item": "minecraft:porkchop",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "minecraft:beef",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "minecraft:muttonRaw",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "minecraft:rabbit",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "minecraft:chicken",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "pr:paleomeat",
            "priority": 0,
            "max_amount": 1
          },
          {
            "item": "pr:paleosteak",
            "priority": 0,
            "max_amount": 1
          }
        ]
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/pr_dimetro.json"
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 95,
            "remove": {},
            "add": {
              "component_groups": [
                "minecraft:pig_adult"
              ]
            }
          },
          {
            "weight": 5,
            "remove": {},
            "add": {
              "component_groups": [
                "minecraft:pig_baby"
              ]
            }
          }
        ]
      },
      "minecraft:entity_born": {
        "remove": {},
        "add": {
          "component_groups": [
            "minecraft:pig_baby"
          ]
        }
      },
      "minecraft:ageable_grow_up": {
        "remove": {
          "component_groups": [
            "minecraft:pig_baby"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:pig_adult"
          ]
        }
      },
      "on:death": {
        "run_command": {
          "command": []
        }
      },
      "on:hurt": {
        "run_command": {
          "command": []
        }
      },
      "on:hurt_by_player": {
        "run_command": {
          "command": []
        }
      },
      "on:ignite": {
        "run_command": {
          "command": []
        }
      },
      "on:target_acquired": {
        "run_command": {
          "command": []
        }
      },
      "on:target_escape": {
        "run_command": {
          "command": []
        }
      },
      "on:wake_with_owner": {
        "run_command": {
          "command": []
        }
      },
      "on:tick_action": {
        "run_command": {
          "command": []
        }
      },
      "pr:on_tame": {
        "add": {
          "component_groups": [
            "pr:tamed"
          ]
        }
      },
      "pr:follow": {
        "add": {
          "component_groups": [
            "pr:follow"
          ]
        }
      },
      "pr:freeroam": {
        "remove": {
          "component_groups": [
            "pr:follow"
          ]
        },
        "add": {
          "component_groups": [
            "pr:tamed"
          ]
        }
      }
    }
  }
}