minecraft:experience_reward
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
on_bred | Text or Object or Decimal | — | A Molang expression defining the amount of experience rewarded when this entity is successfully bred. |
on_death | Text 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:
ArmadilloAxolotlBeeBlazeBoggedBreezeCamelCamel HuskCatCave SpiderChickenCodCowCreeperDolphinDonkeyDrownedElder GuardianEndermanEndermiteEvokerFoxFrogGhastGlow SquidGoatGuardianHappy GhastHoglinHorseHuskLlamaMagma CubeMooshroomMuleNautilusOcelotPandaParchedParrotPhantomPigPiglinPiglin BrutePillagerPlayerPolar BearPufferfishRabbitRavagerSalmonSheepShulkerSilverfishSkeletonSkeleton HorseSlimeSnifferSpiderSquidStrayStriderSulfur CubeTrader LlamaTropical FishTurtleVexVindicatorWardenWitchWitherWither SkeletonWolfZoglinZombieZombie HorseZombie NautilusZombified PiglinZombie VillagerZombie Villager
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.
Related components
healthmovementattackscalefollow_rangeunderwater_movementknockback_resistanceuses_legacy_frictionbuoyantvariable_max_auto_stepattack_cooldownflying_speedwater_movementattack_damageblock_movement_slowdown_immunitygroup_sizemovement_sound_distance_offsetstrengthair_drag_modifierbouncinessfriction_modifierlava_movementplayer.exhaustionplayer.experience