minecraft:experience_reward

Properties

PropertyTypeDefaultWhat it does
on_bredText or Object or Decimal—A Molang expression defining the amount of experience rewarded when this entity is successfully bred.
on_deathText or Object or Decimal—A Molang expression defining the amount of experience rewarded when this entity dies.

Example from the game files

This is how vanilla Pillager uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:experience_reward": {
    "on_death": "query.last_hit_by_player ? (query.is_baby ? 12 : 5) + (Math.die_roll(query.equipment_count,1,3)) : 0"
  }
}

Used by 80

Vanilla entities with minecraft:experience_reward in their definition:

Set it without writing JSON

The mob maker writes this component for you from a form and puts it in a ready-to-import .mcaddon.

Open the maker

Related components