Custom Buff Types
Custom Buff Types
Section titled “Custom Buff Types”Journey’s buff system is extensible. Third-party Fabric mods can register new buff types that integrate with Journey’s reward system, MoLang scripts, and commands.
How It Works
Section titled “How It Works”Journey ships with four built-in buff types: attribute, potion, script, and shiny_chance. Mod developers can register additional types using Journey’s BuffTypeRegistry API.
Once registered, server admins configure custom buffs the same way as built-in ones — JSON files in config/journey/buffs/ using the new type name.
Example: If a mod registers a daycare_speed buff type, admins would create:
File: config/journey/buffs/daycare_boost.json
{ "id": "daycare_boost", "type": "daycare_speed", "name": "Daycare Speed Boost", "description": "Pokemon eggs hatch faster in the daycare", "max_stacks": 3, "is_debuff": false, "hidden": false, "speed_multiplier": 1.5}The type field tells Journey which registered handler to use. The remaining fields depend on what the mod developer supports.
For Server Admins
Section titled “For Server Admins”If you’ve installed a mod that adds custom buff types to Journey:
- Check the mod’s documentation for the type name and available fields
- Create a JSON file in
config/journey/buffs/using the custom type - Use it in rewards and MoLang scripts just like built-in buffs
Custom buffs work with all Journey systems:
- Task and levelable rewards via
"type": "buff" - MoLang functions:
q.player.apply_buff(),q.player.has_buff(),q.player.remove_buff() - Commands:
/journey buff give,/journey buff remove - Journey Client buff display
For Mod Developers
Section titled “For Mod Developers”To create a custom buff type, you need to:
- Extend
BuffDefinition— Define your buff’s configuration (loaded from JSON) - Extend
BuffInstance— Define your buff’s runtime behavior (apply, tick, remove) - Register with
BuffTypeRegistry— Map your type name to a factory that creates definitions from JSON - Register instance deserializer — So Journey can load your buff from saved data
The key classes are in the aster.amo.journey.buff package:
BuffTypeRegistry— Register new buff typesBuffRegistry— Register instance deserializers, apply buffs to playersBuffDefinition— Base class for buff configurationBuffInstance— Base class for active buff behaviorRemovalReason— Enum for why a buff was removed (EXPIRED, MANUAL, DEATH, SOURCE_REMOVED, REPLACED)
Refer to Journey’s built-in buff types as implementation examples. Registration should happen during your mod’s onInitialize() before Journey loads buff configs.