Cobblemon 1.8.4 Event Hooks & Battle Scripts

Cobblemon 1.8.4 Callbacks, Bag Item Scripts & Moveset Builders

Every official survival gameplay hook bundled inside Cobblemon 1.8.4—all 12 MoLang event callbacks (data/cobblemon/callbacks/) that drive Marks, Alpha reward drops, PC Box Wallpaper unlocks, and Burmy cloak changes, all 11 in-battle Bag Item scripts (bag_items/*.js) plus 1 held-item script (eggantberry.js), and the official Wild vs Alpha Moveset Builders (moveset_builders/).

MoLang Event Callbacks
12 Files Across 7 Hooks
In-Battle Bag Items
11 Scripts (+ 1 Held Item JS)
Moveset Builders
2 Profiles (wild.json & alpha.json)
Action Effects Hub
156 Action Effects →
Script Runtime
Mechanic Group
MoLang Callback · battle_endedBurmy Cloak Change After Battle

After a battle ends, checks each player's current biome against #cobblemon:form_change/bagworm_cloak/sandy_cloak, trash_cloak, and plant_cloak. Any participating Burmy that faced an opponent switches to the matching bagworm_cloak aspect.

Related: /pokemon/burmy/ · /aspects/bagworm-cloak/

battle_ended/burmy_cloak_change.molang14 lines
MoLang Callback · battle_faintedAlpha Boss Fainted Reward Drops

When a wild Alpha Pokémon faints in battle, drops a level-scaled reward table (Tier 1 Lv. 1–30, Tier 2 Lv. 31–50, Tier 3 Lv. 51–65, Tier 4 Lv. 66+) plus two independent 50% type-reward rolls (Type Tier 1 Lv. 1–50, Type Tier 2 Lv. 51+; mono-type Alphas roll their single type twice).

Related: /alphas/ · /guides/cobblemon-alpha-pokemon-and-herd-hunting-guide/

battle_fainted/pokemon_alpha_drops.molang34 lines
MoLang Callback · battle_victoryNPC Battle Victory & Defeat Scripts

Runs configured MoLang hooks (on_defeat, on_player_wins, on_victory, on_player_loses) and console command templates (player_win_command, player_lose_command with {{player}}, {{player_id}}, {{npc}}, {{npc_id}}, {{pokemon_id}} placeholders) on scriptable winners and losers.

Related: /behaviours/

battle_victory/npc_battle_end_scripts.molang73 lines
MoLang Callback · bobber_spawn_pokemon_postFishing Mark Potential Assignment

Adds cobblemon:mark_fishing as a potential mark to every Pokémon entity spawned from a Poké Rod fishing bobber (rolled on capture, 4% base chance in mark_fishing.json).

Related: /marks/mark-fishing/ · /pokerods/

bobber_spawn_pokemon_post/apply_marks.molang1 line
MoLang Callback · fossil_revivedFossil Revival Potential & Applied Marks

Adds 31 potential marks (mark_revival 4%, mark_uncommon 2%, mark_rare 0.1%, and all 28 personality marks 1%) to every fossil-revived Pokémon, and immediately rolls them via apply_potential_marks when revived by a player.

Related: /marks/mark-revival/ · /fossils/

fossil_revived/apply_marks.molang36 lines
MoLang Callback · player_tick_prePartner Mark Distance Tracker

Runs every 200 ticks (10 seconds), summing 18 vanilla and Cobblemon riding distance stats divided by 100 (blocks). Each time a player crosses a new 10,000-block milestone, every party Pokémon with friendship >= 200 rolls add_marks_with_chance('cobblemon:mark_partner') (1% per milestone).

Related: /marks/mark-partner/ · /rideable/

player_tick_pre/partner_mark.molang36 lines
MoLang Callback · player_tick_preBiome PC Box Wallpaper Unlocks

Runs once per second (every 20 ticks), checking the player's current biome tag and unlocking 5 PC Box Wallpapers automatically: biome_cave (#cobblemon:is_cave), biome_forest (#cobblemon:is_forest), biome_ocean (#cobblemon:is_ocean), biome_nether (#minecraft:is_nether), and biome_the_end (#cobblemon:is_end).

Related: /decor/#unlockable-wallpapers

player_tick_pre/wallpaper_unlocks.molang30 lines
MoLang Callback · pokemon_capturedCapture Potential Mark Roll

Calls q.pokemon.apply_potential_marks whenever a Pokémon is captured, rolling all queued weather, time, fishing, rare, uncommon, and personality potential marks.

Related: /marks/

pokemon_captured/apply_marks.molang1 line
MoLang Callback · pokemon_capturedCapture Bait Aspect Cleanup

Strips temporary wild spawn bait aspects (honey_drenched and poke_snack_crumbed) from a Pokémon as soon as it is captured.

Related: /aspects/ · /baits/

pokemon_captured/remove_aspects.molang4 lines
MoLang Callback · pokemon_capturedAlpha PC Box Wallpaper Unlock

Unlocks the cobblemon:pokemon_alpha PC Box Wallpaper for the capturing player whenever the captured Pokémon has is_alpha set.

Related: /decor/#unlockable-wallpapers · /alphas/

pokemon_captured/wallpaper_unlocks.molang4 lines
MoLang Callback · pokemon_entity_spawnSize & Alpha Direct Spawn Marks

Automatically grants cobblemon:mark_mini to spawned Pokémon with size_category == 'XS' (excluding Alphas) and cobblemon:mark_jumbo to spawned Pokémon with size_category == 'XL' or is_alpha.

Related: /marks/mark-mini/ · /marks/mark-jumbo/

pokemon_entity_spawn/apply_marks.molang6 lines
MoLang Callback · pokemon_entity_spawnWild Spawn Weather, Time & Personality Marks

Queues up to 42 potential marks on wild Pokémon spawns based on exact biome tags, Y > 191 altitude, rain/thunder/snow weather, Overworld time_of_day tick windows, plus Rare, Uncommon, and all 28 Personality marks.

Related: /marks/

pokemon_entity_spawn/apply_potential_marks.molang73 lines
Showdown Bag Item ScriptClear Boosts

Resets every active stat boost stage in pokemon.boosts back to 0 and logs a -clearboost battle event.

clear_boost527 B
Showdown Bag Item ScriptStatus Cure (Antidote / Full Heal / Remedies)

Checks each status ID in data against the Pokémon's primary status and volatile statuses (such as confusion), curing any matching conditions.

cure_status <status...>903 B
Showdown Bag Item ScriptDire Hit

Adds the focusenergy volatile status to the target Pokémon in battle to raise critical-hit ratio.

dire_hit371 B
Showdown Bag Item ScriptElixir / Max Elixir

Restores PP across all baseMoveSlots by data[0] (or 999 / full Max PP when omitted) and calls pokemon.updatePP().

elixir [amount]707 B
Showdown Bag Item ScriptEther / Max Ether

Restores PP to a single move slot by data[1] (or 999 / full Max PP when amount is omitted) and calls pokemon.updatePP().

ether <moveId> [amount]771 B
Showdown Bag Item ScriptFull Restore

Restores full HP (maxhp - hp), cures any primary status condition, and removes the confusion volatile status in one action.

full_restore573 B
Showdown Bag Item ScriptGuard Spec.

Adds the mist volatile status to the target Pokémon in battle to protect stat stages from reductions.

guard_spec366 B
Showdown Bag Item ScriptPotion / Flat HP Heal

Heals the target Pokémon by the integer HP amount passed in data[0] (used by Potion 20, Super Potion 60, Hyper Potion 120, Max Potion, etc.) and logs a -heal event.

potion <amount>485 B
Showdown Bag Item ScriptFractional HP Heal (Berries / Drinks)

Heals floor(maxhp * ratio) HP in battle; if data[1] is truthy (e.g. flavor-disliked pinch berries), also applies the confusion volatile status.

potion_by_portion <ratio> [causeConfusion]673 B
Showdown Bag Item ScriptRevive / Max Revive

Revives a fainted Pokémon at floor(maxhp * healthRatio) HP (0.5 for Revive, 1.0 for Max Revive), increments side.pokemonLeft, clears faint flags, and queues an instaswitch if the fainted slot is active.

revive <healthRatio>950 B
Showdown Bag Item ScriptX-Stat Battle Boosts (X Attack..X Accuracy)

Applies a Showdown stat stage boost (e.g. atk +2, def +2, spa +2, spd +2, spe +2, accuracy +2) via battle.boost() with effectType 'BagItem'.

x_stat <stat> <stages>536 B
Showdown Held Item ScriptEggant Berry (Held Item Script)

Custom Showdown held-item script (Natural Gift 80 BP Normal): automatically eats the Eggant Berry via onUpdate whenever the holder has the attract (infatuation) volatile status, curing Attract.

held_item: eggantberry665 B

All 12 Official MoLang Event Callbacks

49 AI Behaviours →

Cobblemon 1.8.4 ships twelve MoLang event scripts under data/cobblemon/callbacks/<event>/ that fire automatically during battles, captures, spawns, fossil revivals, fishing, and player ticks:

Callback & FileEvent HookVerified In-Game BehaviourSize
Burmy Cloak Change After Battle
battle_ended/burmy_cloak_change.molang
battle_endedAfter a battle ends, checks each player's current biome against #cobblemon:form_change/bagworm_cloak/sandy_cloak, trash_cloak, and plant_cloak. Any participating Burmy that faced an opponent switches to the matching bagworm_cloak aspect.14 lines (679 B)
Alpha Boss Fainted Reward Drops
battle_fainted/pokemon_alpha_drops.molang
battle_faintedWhen a wild Alpha Pokémon faints in battle, drops a level-scaled reward table (Tier 1 Lv. 1–30, Tier 2 Lv. 31–50, Tier 3 Lv. 51–65, Tier 4 Lv. 66+) plus two independent 50% type-reward rolls (Type Tier 1 Lv. 1–50, Type Tier 2 Lv. 51+; mono-type Alphas roll their single type twice).34 lines (1387 B)
NPC Battle Victory & Defeat Scripts
battle_victory/npc_battle_end_scripts.molang
battle_victoryRuns configured MoLang hooks (on_defeat, on_player_wins, on_victory, on_player_loses) and console command templates (player_win_command, player_lose_command with {{player}}, {{player_id}}, {{npc}}, {{npc_id}}, {{pokemon_id}} placeholders) on scriptable winners and losers.73 lines (2653 B)
Fishing Mark Potential Assignment
bobber_spawn_pokemon_post/apply_marks.molang
bobber_spawn_pokemon_postAdds cobblemon:mark_fishing as a potential mark to every Pokémon entity spawned from a Poké Rod fishing bobber (rolled on capture, 4% base chance in mark_fishing.json).1 line (63 B)
Fossil Revival Potential & Applied Marks
fossil_revived/apply_marks.molang
fossil_revivedAdds 31 potential marks (mark_revival 4%, mark_uncommon 2%, mark_rare 0.1%, and all 28 personality marks 1%) to every fossil-revived Pokémon, and immediately rolls them via apply_potential_marks when revived by a player.36 lines (1366 B)
Partner Mark Distance Tracker
player_tick_pre/partner_mark.molang
player_tick_preRuns every 200 ticks (10 seconds), summing 18 vanilla and Cobblemon riding distance stats divided by 100 (blocks). Each time a player crosses a new 10,000-block milestone, every party Pokémon with friendship >= 200 rolls add_marks_with_chance('cobblemon:mark_partner') (1% per milestone).36 lines (1712 B)
Biome PC Box Wallpaper Unlocks
player_tick_pre/wallpaper_unlocks.molang
player_tick_preRuns once per second (every 20 ticks), checking the player's current biome tag and unlocking 5 PC Box Wallpapers automatically: biome_cave (#cobblemon:is_cave), biome_forest (#cobblemon:is_forest), biome_ocean (#cobblemon:is_ocean), biome_nether (#minecraft:is_nether), and biome_the_end (#cobblemon:is_end).30 lines (1078 B)
Capture Potential Mark Roll
pokemon_captured/apply_marks.molang
pokemon_capturedCalls q.pokemon.apply_potential_marks whenever a Pokémon is captured, rolling all queued weather, time, fishing, rare, uncommon, and personality potential marks.1 line (33 B)
Capture Bait Aspect Cleanup
pokemon_captured/remove_aspects.molang
pokemon_capturedStrips temporary wild spawn bait aspects (honey_drenched and poke_snack_crumbed) from a Pokémon as soon as it is captured.4 lines (76 B)
Alpha PC Box Wallpaper Unlock
pokemon_captured/wallpaper_unlocks.molang
pokemon_capturedUnlocks the cobblemon:pokemon_alpha PC Box Wallpaper for the capturing player whenever the captured Pokémon has is_alpha set.4 lines (104 B)
Size & Alpha Direct Spawn Marks
pokemon_entity_spawn/apply_marks.molang
pokemon_entity_spawnAutomatically grants cobblemon:mark_mini to spawned Pokémon with size_category == 'XS' (excluding Alphas) and cobblemon:mark_jumbo to spawned Pokémon with size_category == 'XL' or is_alpha.6 lines (266 B)
Wild Spawn Weather, Time & Personality Marks
pokemon_entity_spawn/apply_potential_marks.molang
pokemon_entity_spawnQueues up to 42 potential marks on wild Pokémon spawns based on exact biome tags, Y > 191 altitude, rain/thunder/snow weather, Overworld time_of_day tick windows, plus Rare, Uncommon, and all 28 Personality marks.73 lines (3757 B)

All 11 In-Battle Bag Item Scripts & Eggant Berry Held Script

All 732 Items →

In-battle medicine and stat-boosting items execute directly inside Cobblemon's Showdown battle engine via data/cobblemon/bag_items/*.js, alongside the custom data/cobblemon/held_items/eggantberry.js script:

Script & Jar FileInvocation / HookVerified Battle Effect
Clear Boosts
bag_items/clear_boost.js
clear_boostResets every active stat boost stage in pokemon.boosts back to 0 and logs a -clearboost battle event.
Status Cure (Antidote / Full Heal / Remedies)
bag_items/cure_status.js
cure_status <status...>Checks each status ID in data against the Pokémon's primary status and volatile statuses (such as confusion), curing any matching conditions.
Dire Hit
bag_items/dire_hit.js
dire_hitAdds the focusenergy volatile status to the target Pokémon in battle to raise critical-hit ratio.
Elixir / Max Elixir
bag_items/elixir.js
elixir [amount]Restores PP across all baseMoveSlots by data[0] (or 999 / full Max PP when omitted) and calls pokemon.updatePP().
Ether / Max Ether
bag_items/ether.js
ether <moveId> [amount]Restores PP to a single move slot by data[1] (or 999 / full Max PP when amount is omitted) and calls pokemon.updatePP().
Full Restore
bag_items/full_restore.js
full_restoreRestores full HP (maxhp - hp), cures any primary status condition, and removes the confusion volatile status in one action.
Guard Spec.
bag_items/guard_spec.js
guard_specAdds the mist volatile status to the target Pokémon in battle to protect stat stages from reductions.
Potion / Flat HP Heal
bag_items/potion.js
potion <amount>Heals the target Pokémon by the integer HP amount passed in data[0] (used by Potion 20, Super Potion 60, Hyper Potion 120, Max Potion, etc.) and logs a -heal event.
Fractional HP Heal (Berries / Drinks)
bag_items/potion_by_portion.js
potion_by_portion <ratio> [causeConfusion]Heals floor(maxhp * ratio) HP in battle; if data[1] is truthy (e.g. flavor-disliked pinch berries), also applies the confusion volatile status.
Revive / Max Revive
bag_items/revive.js
revive <healthRatio>Revives a fainted Pokémon at floor(maxhp * healthRatio) HP (0.5 for Revive, 1.0 for Max Revive), increments side.pokemonLeft, clears faint flags, and queues an instaswitch if the fainted slot is active.
X-Stat Battle Boosts (X Attack..X Accuracy)
bag_items/x_stat.js
x_stat <stat> <stages>Applies a Showdown stat stage boost (e.g. atk +2, def +2, spa +2, spd +2, spe +2, accuracy +2) via battle.boost() with effectType 'BagItem'.
Eggant Berry (Held Item Script)
held_items/eggantberry.js
held_item: eggantberryCustom Showdown held-item script (Natural Gift 80 BP Normal): automatically eats the Eggant Berry via onUpdate whenever the holder has the attract (infatuation) volatile status, curing Attract.

Wild vs Alpha Moveset Builders & Move Weights

All 426 Alpha Bosses →

When spawning wild Pokémon, Cobblemon 1.8.4 selects their starting four moves using data/cobblemon/moveset_builders/wild.json and alpha.json (both type cobblemon:default). Standard wild Pokémon pull exclusively from level-up moves, whereas wild Alpha Pokémon fill Move Slots 3 and 4 from their TM learnset (falling back to level-up moves). Global move selection weight overrides in data/cobblemon/move_weights.json: focusblast: 50, terablast: 0 (setting Tera Blast weight to 0 prevents wild Alpha TM pools from rolling it).

Move SlotStandard Wild (wild.json)Alpha Boss (alpha.json)
SLOT1last_offensive → last_leveluplast_suitable_offensive → last_offensive → last_levelup
SLOT2last_leveluplast_offensive → last_levelup
SLOT3last_leveluptm → last_levelup
SLOT4last_leveluptm → last_levelup