# Rarity levels
  # Rarity in storage
    data modify storage mob_heads:root data.rarity_allay set value 1
    data modify storage mob_heads:root data.rarity_armadillo set value 1
    data modify storage mob_heads:root data.rarity_axolotl set value 2
    data modify storage mob_heads:root data.rarity_axolotl_blue set value 5

    data modify storage mob_heads:root data.rarity_bat set value 2
    data modify storage mob_heads:root data.rarity_bee set value 1
    data modify storage mob_heads:root data.rarity_blaze set value 0
    data modify storage mob_heads:root data.rarity_bogged set value 1
    data modify storage mob_heads:root data.rarity_breeze set value 2

    data modify storage mob_heads:root data.rarity_camel set value 1
    data modify storage mob_heads:root data.rarity_cat set value 2
    data modify storage mob_heads:root data.rarity_cave_spider set value 0
    data modify storage mob_heads:root data.rarity_chicken set value 0
    data modify storage mob_heads:root data.rarity_cod set value 1
    data modify storage mob_heads:root data.rarity_cow set value 0
    data modify storage mob_heads:root data.rarity_creaking set value 3
    data modify storage mob_heads:root data.rarity_creeper set value 0
    data modify storage mob_heads:root data.rarity_creeper_charged set value 3

    data modify storage mob_heads:root data.rarity_dolphin set value 1
    data modify storage mob_heads:root data.rarity_donkey set value 1
    data modify storage mob_heads:root data.rarity_drowned set value 0

    data modify storage mob_heads:root data.rarity_elder_guardian set value 5
    data modify storage mob_heads:root data.rarity_ender_dragon set value 4
    data modify storage mob_heads:root data.rarity_enderman set value 0
    data modify storage mob_heads:root data.rarity_endermite set value 3
    data modify storage mob_heads:root data.rarity_evoker set value 3

    data modify storage mob_heads:root data.rarity_fox set value 1
    data modify storage mob_heads:root data.rarity_frog set value 1

    data modify storage mob_heads:root data.rarity_ghast set value 1
    data modify storage mob_heads:root data.rarity_glow_squid set value 1
    data modify storage mob_heads:root data.rarity_goat set value 1
    data modify storage mob_heads:root data.rarity_guardian set value 0

    data modify storage mob_heads:root data.rarity_happy_ghast set value 2
    data modify storage mob_heads:root data.rarity_hoglin set value 1
    data modify storage mob_heads:root data.rarity_horse set value 1
    data modify storage mob_heads:root data.rarity_husk set value 1

    data modify storage mob_heads:root data.rarity_illusioner set value 3
    data modify storage mob_heads:root data.rarity_iron_golem set value 1

    data modify storage mob_heads:root data.rarity_llama set value 1

    data modify storage mob_heads:root data.rarity_magma_cube set value 0
    data modify storage mob_heads:root data.rarity_mooshroom set value 2
    data modify storage mob_heads:root data.rarity_mooshroom_brown set value 3
    data modify storage mob_heads:root data.rarity_mule set value 1

    data modify storage mob_heads:root data.rarity_ocelot set value 2

    data modify storage mob_heads:root data.rarity_panda set value 2
    data modify storage mob_heads:root data.rarity_panda_special set value 3
    data modify storage mob_heads:root data.rarity_parrot set value 2
    data modify storage mob_heads:root data.rarity_phantom set value 1

    data modify storage mob_heads:root data.rarity_pig set value 0
    data modify storage mob_heads:root data.rarity_piglin_brute set value 5
    data modify storage mob_heads:root data.rarity_piglin set value 0
    data modify storage mob_heads:root data.rarity_pillager set value 1
    data modify storage mob_heads:root data.rarity_polar_bear set value 1
    data modify storage mob_heads:root data.rarity_pufferfish set value 1

    data modify storage mob_heads:root data.rarity_rabbit set value 1
    data modify storage mob_heads:root data.rarity_ravager set value 2

    data modify storage mob_heads:root data.rarity_salmon set value 1
    data modify storage mob_heads:root data.rarity_sheep set value 0
    data modify storage mob_heads:root data.rarity_shulker set value 1
    data modify storage mob_heads:root data.rarity_silverfish set value 0
    data modify storage mob_heads:root data.rarity_skeleton_horse set value 5
    data modify storage mob_heads:root data.rarity_skeleton set value 0
    data modify storage mob_heads:root data.rarity_slime set value 0
    data modify storage mob_heads:root data.rarity_sniffer set value 1
    data modify storage mob_heads:root data.rarity_snow_golem set value 1
    data modify storage mob_heads:root data.rarity_spider set value 0
    data modify storage mob_heads:root data.rarity_squid set value 1
    data modify storage mob_heads:root data.rarity_stray set value 1
    data modify storage mob_heads:root data.rarity_strider set value 1

    data modify storage mob_heads:root data.rarity_tadpole set value 3
    data modify storage mob_heads:root data.rarity_trader_llama set value 2
    data modify storage mob_heads:root data.rarity_tropical_fish set value 1

    data modify storage mob_heads:root data.rarity_turtle set value 1

    data modify storage mob_heads:root data.rarity_vex set value 1
    data modify storage mob_heads:root data.rarity_villager set value 2
    data modify storage mob_heads:root data.rarity_vindicator set value 2

    data modify storage mob_heads:root data.rarity_wandering_trader set value 2
    data modify storage mob_heads:root data.rarity_warden set value 4
    data modify storage mob_heads:root data.rarity_witch set value 2
    data modify storage mob_heads:root data.rarity_wither set value 4
    data modify storage mob_heads:root data.rarity_wither_invulnerable set value 5
    data modify storage mob_heads:root data.rarity_wolf set value 1

    data modify storage mob_heads:root data.rarity_zoglin set value 2
    data modify storage mob_heads:root data.rarity_zombie_horse set value 5
    data modify storage mob_heads:root data.rarity_zombie_villager set value 2
    data modify storage mob_heads:root data.rarity_zombie set value 0
    data modify storage mob_heads:root data.rarity_zombified_piglin set value 0

  # Updates
    data modify storage mob_heads:root data.rarity_copper_golem set value 2
    data modify storage mob_heads:root data.rarity_nautilus set value 3
    data modify storage mob_heads:root data.rarity_parched set value 3
    data modify storage mob_heads:root data.rarity_zombie_nautilus set value 3
    data modify storage mob_heads:root data.rarity_camel_husk set value 3

  # Rarity scoreboard
    scoreboard players set &allay mob_heads.rarity 1
    scoreboard players set &armadillo mob_heads.rarity 1
    scoreboard players set &axolotl mob_heads.rarity 2
    scoreboard players set &axolotl_blue mob_heads.rarity 5

    scoreboard players set &bat mob_heads.rarity 2
    scoreboard players set &bee mob_heads.rarity 1
    scoreboard players set &blaze mob_heads.rarity 0
    scoreboard players set &bogged mob_heads.rarity 1
    scoreboard players set &breeze mob_heads.rarity 2

    scoreboard players set &camel mob_heads.rarity 1
    scoreboard players set &cat mob_heads.rarity 2
    scoreboard players set &cave_spider mob_heads.rarity 0
    scoreboard players set &chicken mob_heads.rarity 0
    scoreboard players set &cod mob_heads.rarity 1
    scoreboard players set &cow mob_heads.rarity 0
    scoreboard players set &creaking mob_heads.rarity 3
    scoreboard players set &creeper mob_heads.rarity 0
    scoreboard players set &creeper_charged mob_heads.rarity 3

    scoreboard players set &dolphin mob_heads.rarity 1
    scoreboard players set &donkey mob_heads.rarity 1
    scoreboard players set &drowned mob_heads.rarity 0

    scoreboard players set &elder_guardian mob_heads.rarity 5
    scoreboard players set &ender_dragon mob_heads.rarity 4
    scoreboard players set &enderman mob_heads.rarity 0
    scoreboard players set &endermite mob_heads.rarity 3
    scoreboard players set &evoker mob_heads.rarity 3

    scoreboard players set &fox mob_heads.rarity 1
    scoreboard players set &frog mob_heads.rarity 1

    scoreboard players set &ghast mob_heads.rarity 1
    scoreboard players set &glow_squid mob_heads.rarity 1
    scoreboard players set &goat mob_heads.rarity 1
    scoreboard players set &guardian mob_heads.rarity 0

    scoreboard players set &happy_ghast mob_heads.rarity 2
    scoreboard players set &hoglin mob_heads.rarity 1
    scoreboard players set &horse mob_heads.rarity 1
    scoreboard players set &husk mob_heads.rarity 1

    scoreboard players set &illusioner mob_heads.rarity 3
    scoreboard players set &iron_golem mob_heads.rarity 1

    scoreboard players set &llama mob_heads.rarity 1

    scoreboard players set &magma_cube mob_heads.rarity 0
    scoreboard players set &mooshroom mob_heads.rarity 2
    scoreboard players set &mooshroom_brown mob_heads.rarity 3
    scoreboard players set &mule mob_heads.rarity 1

    scoreboard players set &ocelot mob_heads.rarity 2

    scoreboard players set &panda mob_heads.rarity 2
    scoreboard players set &panda_special mob_heads.rarity 3
    scoreboard players set &parrot mob_heads.rarity 2
    scoreboard players set &phantom mob_heads.rarity 1

    scoreboard players set &pig mob_heads.rarity 0
    scoreboard players set &piglin_brute mob_heads.rarity 5
    scoreboard players set &piglin mob_heads.rarity 0
    scoreboard players set &pillager mob_heads.rarity 1
    scoreboard players set &polar_bear mob_heads.rarity 1
    scoreboard players set &pufferfish mob_heads.rarity 1

    scoreboard players set &rabbit mob_heads.rarity 1
    scoreboard players set &ravager mob_heads.rarity 2

    scoreboard players set &salmon mob_heads.rarity 1
    scoreboard players set &sheep mob_heads.rarity 0
    scoreboard players set &shulker mob_heads.rarity 1
    scoreboard players set &silverfish mob_heads.rarity 0
    scoreboard players set &skeleton_horse mob_heads.rarity 5
    scoreboard players set &skeleton mob_heads.rarity 0
    scoreboard players set &slime mob_heads.rarity 0
    scoreboard players set &sniffer mob_heads.rarity 1
    scoreboard players set &snow_golem mob_heads.rarity 1
    scoreboard players set &spider mob_heads.rarity 0
    scoreboard players set &squid mob_heads.rarity 1
    scoreboard players set &stray mob_heads.rarity 1
    scoreboard players set &strider mob_heads.rarity 1

    scoreboard players set &tadpole mob_heads.rarity 3
    scoreboard players set &trader_llama mob_heads.rarity 2
    scoreboard players set &tropical_fish mob_heads.rarity 1

    scoreboard players set &turtle mob_heads.rarity 1

    scoreboard players set &vex mob_heads.rarity 1
    scoreboard players set &villager mob_heads.rarity 2
    scoreboard players set &vindicator mob_heads.rarity 2

    scoreboard players set &wandering_trader mob_heads.rarity 2
    scoreboard players set &warden mob_heads.rarity 4
    scoreboard players set &witch mob_heads.rarity 2
    scoreboard players set &wither mob_heads.rarity 4
    scoreboard players set &wither_invulnerable mob_heads.rarity 5
    scoreboard players set &wolf mob_heads.rarity 1

    scoreboard players set &zoglin mob_heads.rarity 2
    scoreboard players set &zombie_horse mob_heads.rarity 5
    scoreboard players set &zombie_villager mob_heads.rarity 2
    scoreboard players set &zombie mob_heads.rarity 0
    scoreboard players set &zombified_piglin mob_heads.rarity 0

  # Updates
    execute unless score &copper_golem mob_heads.rarity = &copper_golem mob_heads.rarity run scoreboard players set &copper_golem mob_heads.rarity 2
    execute unless score &nautilus mob_heads.rarity = &nautilus mob_heads.rarity run scoreboard players set &nautilus mob_heads.rarity 3
    execute unless score &parched mob_heads.rarity = &parched mob_heads.rarity run scoreboard players set &parched mob_heads.rarity 3
    execute unless score &zombie_nautilus mob_heads.rarity = &zombie_nautilus mob_heads.rarity run scoreboard players set &zombie_nautilus mob_heads.rarity 3
    execute unless score &camel_husk mob_heads.rarity = &camel_husk mob_heads.rarity run scoreboard players set &camel_husk mob_heads.rarity 3

  # Dialog rarity in storage
    data modify storage mob_heads:root data.dialog_rarity_allay set value "$(dialog_rarity_allay)"
    data modify storage mob_heads:root data.dialog_rarity_armadillo set value "$(dialog_rarity_armadillo)"
    data modify storage mob_heads:root data.dialog_rarity_axolotl set value "$(dialog_rarity_axolotl)"
    data modify storage mob_heads:root data.dialog_rarity_axolotl_blue set value "$(dialog_rarity_axolotl_blue)"

    data modify storage mob_heads:root data.dialog_rarity_bat set value "$(dialog_rarity_bat)"
    data modify storage mob_heads:root data.dialog_rarity_bee set value "$(dialog_rarity_bee)"
    data modify storage mob_heads:root data.dialog_rarity_blaze set value "$(dialog_rarity_blaze)"
    data modify storage mob_heads:root data.dialog_rarity_bogged set value "$(dialog_rarity_bogged)"
    data modify storage mob_heads:root data.dialog_rarity_breeze set value "$(dialog_rarity_breeze)"

    data modify storage mob_heads:root data.dialog_rarity_camel set value "$(dialog_rarity_camel)"
    data modify storage mob_heads:root data.dialog_rarity_cat set value "$(dialog_rarity_cat)"
    data modify storage mob_heads:root data.dialog_rarity_cave_spider set value "$(dialog_rarity_cave_spider)"
    data modify storage mob_heads:root data.dialog_rarity_chicken set value "$(dialog_rarity_chicken)"
    data modify storage mob_heads:root data.dialog_rarity_cod set value "$(dialog_rarity_cod)"
    data modify storage mob_heads:root data.dialog_rarity_cow set value "$(dialog_rarity_cow)"
    data modify storage mob_heads:root data.dialog_rarity_creaking set value "$(dialog_rarity_creaking)"
    data modify storage mob_heads:root data.dialog_rarity_creeper set value "$(dialog_rarity_creeper)"
    data modify storage mob_heads:root data.dialog_rarity_creeper_charged set value "$(dialog_rarity_creeper_charged)"

    data modify storage mob_heads:root data.dialog_rarity_dolphin set value "$(dialog_rarity_dolphin)"
    data modify storage mob_heads:root data.dialog_rarity_donkey set value "$(dialog_rarity_donkey)"
    data modify storage mob_heads:root data.dialog_rarity_drowned set value "$(dialog_rarity_drowned)"

    data modify storage mob_heads:root data.dialog_rarity_elder_guardian set value "$(dialog_rarity_elder_guardian)"
    data modify storage mob_heads:root data.dialog_rarity_ender_dragon set value "$(dialog_rarity_ender_dragon)"
    data modify storage mob_heads:root data.dialog_rarity_enderman set value "$(dialog_rarity_enderman)"
    data modify storage mob_heads:root data.dialog_rarity_endermite set value "$(dialog_rarity_endermite)"
    data modify storage mob_heads:root data.dialog_rarity_evoker set value "$(dialog_rarity_evoker)"

    data modify storage mob_heads:root data.dialog_rarity_fox set value "$(dialog_rarity_fox)"
    data modify storage mob_heads:root data.dialog_rarity_frog set value "$(dialog_rarity_frog)"

    data modify storage mob_heads:root data.dialog_rarity_ghast set value "$(dialog_rarity_ghast)"
    data modify storage mob_heads:root data.dialog_rarity_glow_squid set value "$(dialog_rarity_glow_squid)"
    data modify storage mob_heads:root data.dialog_rarity_goat set value "$(dialog_rarity_goat)"
    data modify storage mob_heads:root data.dialog_rarity_guardian set value "$(dialog_rarity_guardian)"

    data modify storage mob_heads:root data.dialog_rarity_happy_ghast set value "$(dialog_rarity_happy_ghast)"
    data modify storage mob_heads:root data.dialog_rarity_hoglin set value "$(dialog_rarity_hoglin)"
    data modify storage mob_heads:root data.dialog_rarity_horse set value "$(dialog_rarity_horse)"
    data modify storage mob_heads:root data.dialog_rarity_husk set value "$(dialog_rarity_husk)"

    data modify storage mob_heads:root data.dialog_rarity_illusioner set value "$(dialog_rarity_illusioner)"
    data modify storage mob_heads:root data.dialog_rarity_iron_golem set value "$(dialog_rarity_iron_golem)"

    data modify storage mob_heads:root data.dialog_rarity_llama set value "$(dialog_rarity_llama)"

    data modify storage mob_heads:root data.dialog_rarity_magma_cube set value "$(dialog_rarity_magma_cube)"
    data modify storage mob_heads:root data.dialog_rarity_mooshroom set value "$(dialog_rarity_mooshroom)"
    data modify storage mob_heads:root data.dialog_rarity_mooshroom_brown set value "$(dialog_rarity_mooshroom_brown)"
    data modify storage mob_heads:root data.dialog_rarity_mule set value "$(dialog_rarity_mule)"

    data modify storage mob_heads:root data.dialog_rarity_ocelot set value "$(dialog_rarity_ocelot)"

    # panda = normal, weak
    data modify storage mob_heads:root data.dialog_rarity_panda set value "$(dialog_rarity_panda)"
    # panda special = lazy, brown, playful, aggressive, worried
    data modify storage mob_heads:root data.dialog_rarity_panda_special set value "$(dialog_rarity_panda_special)"
    data modify storage mob_heads:root data.dialog_rarity_parrot set value "$(dialog_rarity_parrot)"
    data modify storage mob_heads:root data.dialog_rarity_phantom set value "$(dialog_rarity_phantom)"
    data modify storage mob_heads:root data.dialog_rarity_pig set value "$(dialog_rarity_pig)"
    data modify storage mob_heads:root data.dialog_rarity_piglin_brute set value "$(dialog_rarity_piglin_brute)"
    data modify storage mob_heads:root data.dialog_rarity_piglin set value "$(dialog_rarity_piglin)"
    data modify storage mob_heads:root data.dialog_rarity_pillager set value "$(dialog_rarity_pillager)"
    data modify storage mob_heads:root data.dialog_rarity_polar_bear set value "$(dialog_rarity_polar_bear)"
    data modify storage mob_heads:root data.dialog_rarity_pufferfish set value "$(dialog_rarity_pufferfish)"

    data modify storage mob_heads:root data.dialog_rarity_rabbit set value "$(dialog_rarity_rabbit)"
    data modify storage mob_heads:root data.dialog_rarity_ravager set value "$(dialog_rarity_ravager)"

    data modify storage mob_heads:root data.dialog_rarity_salmon set value "$(dialog_rarity_salmon)"
    data modify storage mob_heads:root data.dialog_rarity_sheep set value "$(dialog_rarity_sheep)"
    data modify storage mob_heads:root data.dialog_rarity_shulker set value "$(dialog_rarity_shulker)"
    data modify storage mob_heads:root data.dialog_rarity_silverfish set value "$(dialog_rarity_silverfish)"
    data modify storage mob_heads:root data.dialog_rarity_skeleton_horse set value "$(dialog_rarity_skeleton_horse)"
    data modify storage mob_heads:root data.dialog_rarity_skeleton set value "$(dialog_rarity_skeleton)"
    data modify storage mob_heads:root data.dialog_rarity_slime set value "$(dialog_rarity_slime)"
    data modify storage mob_heads:root data.dialog_rarity_sniffer set value "$(dialog_rarity_sniffer)"
    data modify storage mob_heads:root data.dialog_rarity_snow_golem set value "$(dialog_rarity_snow_golem)"
    data modify storage mob_heads:root data.dialog_rarity_spider set value "$(dialog_rarity_spider)"
    data modify storage mob_heads:root data.dialog_rarity_squid set value "$(dialog_rarity_squid)"
    data modify storage mob_heads:root data.dialog_rarity_stray set value "$(dialog_rarity_stray)"
    data modify storage mob_heads:root data.dialog_rarity_strider set value "$(dialog_rarity_strider)"

    data modify storage mob_heads:root data.dialog_rarity_tadpole set value "$(dialog_rarity_tadpole)"
    data modify storage mob_heads:root data.dialog_rarity_trader_llama set value "$(dialog_rarity_trader_llama)"
    data modify storage mob_heads:root data.dialog_rarity_tropical_fish set value "$(dialog_rarity_tropical_fish)"
    data modify storage mob_heads:root data.dialog_rarity_turtle set value "$(dialog_rarity_turtle)"

    data modify storage mob_heads:root data.dialog_rarity_vex set value "$(dialog_rarity_vex)"
    data modify storage mob_heads:root data.dialog_rarity_villager set value "$(dialog_rarity_villager)"
    data modify storage mob_heads:root data.dialog_rarity_vindicator set value "$(dialog_rarity_vindicator)"

    data modify storage mob_heads:root data.dialog_rarity_wandering_trader set value "$(dialog_rarity_wandering_trader)"
    data modify storage mob_heads:root data.dialog_rarity_warden set value "$(dialog_rarity_warden)"
    data modify storage mob_heads:root data.dialog_rarity_witch set value "$(dialog_rarity_witch)"
    data modify storage mob_heads:root data.dialog_rarity_wither set value "$(dialog_rarity_wither)"
    data modify storage mob_heads:root data.dialog_rarity_wither_invulnerable set value "$(dialog_rarity_wither_invulnerable)"
    data modify storage mob_heads:root data.dialog_rarity_wolf set value "$(dialog_rarity_wolf)"

    data modify storage mob_heads:root data.dialog_rarity_zoglin set value "$(dialog_rarity_zoglin)"
    data modify storage mob_heads:root data.dialog_rarity_zombie_horse set value "$(dialog_rarity_zombie_horse)"
    data modify storage mob_heads:root data.dialog_rarity_zombie_villager set value "$(dialog_rarity_zombie_villager)"
    data modify storage mob_heads:root data.dialog_rarity_zombie set value "$(dialog_rarity_zombie)"
    data modify storage mob_heads:root data.dialog_rarity_zombified_piglin set value "$(dialog_rarity_zombified_piglin)"

# Updates
    data modify storage mob_heads:root data.dialog_rarity_copper_golem set value "$(dialog_rarity_copper_golem)"
    data modify storage mob_heads:root data.dialog_rarity_nautilus set value "$(dialog_rarity_nautilus)"
    data modify storage mob_heads:root data.dialog_rarity_parched set value "$(dialog_rarity_parched)"
    data modify storage mob_heads:root data.dialog_rarity_zombie_nautilus set value "$(dialog_rarity_zombie_nautilus)"
    data modify storage mob_heads:root data.dialog_rarity_camel_husk set value "$(dialog_rarity_camel_husk)"