OSCL OS Cobblemon Library v1.1 Documentation
Ctrl K
25% OFF Servers BisectHosting • Code OurStory Discord Join the server CurseForge OS Cobblemon Library GitHub Source & API
OS Cobblemon Library v1.1

OS Cobblemon Library

A lightweight shared Cobblemon API and compatibility library for Fabric and NeoForge.

This is a dependency library.

OS Cobblemon Library does not add standalone gameplay content. Players install it when another mod declares it as a required dependency.

What does the library do?

OS Cobblemon Library centralizes reusable Cobblemon integrations so multiple mods can share the same implementation instead of duplicating loader-specific or Cobblemon-specific code.

Its public API focuses on Pokémon identity, creation, storage, events, battles, Pokédex data and small compatibility boundaries that are useful across multiple projects.

Supported environment

ComponentSupported line
Minecraft1.21.1
Java21
Cobblemon1.8.1 up to, but not including, 1.9.0
LoadersFabric and NeoForge
Current library release1.1.0

Library areas

  • pokemon for identity, species, creation, IVs, abilities, types, labels, size and persistent Pokémon data.
  • entity for read-only PokemonEntity bridge helpers.
  • storage for Party and PC access, matching, lookup and counts.
  • event for Java-friendly Cobblemon event subscriptions and lifecycle management.
  • battle for battle classification, actor inspection and event helpers.
  • pokedex for species, form, variation and completion queries.

Design goals

  1. ReuseKeep repeated Cobblemon integrations in one shared API.
  2. StabilityExpose small documented helpers instead of leaking internal Cobblemon implementation details.
  3. MultiloaderKeep shared behavior in common code and loader wiring in Fabric or NeoForge modules.
  4. ScopeAvoid gameplay systems, balancing rules and generic frameworks that belong in consuming mods.
Public API boundary

Documented classes outside com.ourstory.oscobblemon.internal form the supported public API.

Players & developers

Installation

Install the correct loader build for gameplay, or consume the documented API from another Cobblemon mod.

For players

Download the OS Cobblemon Library JAR matching your loader and place it in the normal mods folder when another mod requires it.

RequirementValue
Minecraft1.21.1
Cobblemon1.8.1 to <1.9.0
Java21
LoadersFabric or NeoForge
Match the loader.

Use the Fabric build on Fabric and the NeoForge build on NeoForge. The library is required on the sides declared by the consuming mod.

Build from source

The Gradle wrapper is committed to the repository.

# Windows
.\gradlew.bat build

# Linux / macOS
./gradlew build

Individual loader builds are also available:

.\gradlew.bat :fabric:build
.\gradlew.bat :neoforge:build

Publish to Maven Local

For local development against another project:

powershell -ExecutionPolicy Bypass -File .\scripts\publish-local.ps1

The script reads the active version from gradle.properties and publishes the common, Fabric and NeoForge artifacts to Maven Local.

Gradle dependency pattern

repositories {
    mavenLocal()
}

val osCobblemonLibraryVersion = "1.1.0"

dependencies {
    compileOnly(
        "com.ourstory:os-cobblemon-library-common:$osCobblemonLibraryVersion"
    )
}

Fabric runtime module:

dependencies {
    modImplementation(
        "com.ourstory:os-cobblemon-library-fabric:$osCobblemonLibraryVersion"
    )
}

NeoForge runtime module:

dependencies {
    modImplementation(
        "com.ourstory:os-cobblemon-library-neoforge:$osCobblemonLibraryVersion"
    )
}

Loader metadata

Consuming mods should also declare OS Cobblemon Library as a required dependency.

// Fabric fabric.mod.json
"depends": {
  "os_cobblemon_library": ">=1.0.0"
}
# NeoForge neoforge.mods.toml
[[dependencies.your_mod_id]]
modId="os_cobblemon_library"
type="required"
versionRange="[1.0.0,)"
ordering="AFTER"
side="BOTH"
Dependency version choice

Set the minimum version required by the API features your mod actually uses.

Supported public surface

API reference

The main public classes exposed by OS Cobblemon Library v1.1.

Pokémon

PokemonIdentity

Canonical species and form identity, aspects, marks, Alpha compatibility and immutable identity snapshots.

PokemonMatcher

Immutable reusable matcher built on Cobblemon's native PokemonProperties. It also supports Alpha, aspects, marks, labels and native size categories.

PokemonSpeciesResolver

Namespace-aware species lookup. Bare IDs default to the Cobblemon namespace while addon namespaces remain intact.

PokemonCreation

Command-free Pokémon parsing, creation, entity creation and server-level spawning through Cobblemon's native property API.

PokemonData

Namespaced persistent Pokémon data with defensive reads and proper Cobblemon change notification on updates or removal.

PokemonIVs

Natural and effective IV inspection, Hyper Training awareness, totals, perfect IV counts and minimum guaranteed perfect natural IVs.

PokemonAbilities

Classifies active abilities as common, hidden, forced or unknown using Cobblemon ability-pool data.

PokemonTypes

Current-form type inspection and matching.

PokemonLabels

Generic access to data-driven Cobblemon form labels without hard-coding category semantics.

PokemonSize

Native size category helpers, translation keys and safe positive scale values for Pokémon and Pokémon entities.

Entities

PokemonEntities

Read-only bridge helpers for Pokémon access, UUID identity, ownership, battle state, busy/evolution state, presence checks and matcher integration.

Storage

PokemonStorage

Shared Party and PC access, UUID lookup, party slots, immutable membership snapshots, predicate queries and counts.

Events

CobblemonEventHooks

Java-friendly subscriptions for repeated Cobblemon event use cases including capture, evolution, battles, sending, recalling, healing, fainting, spawning, persistence, Pokédex updates, hatching, trade, release, nickname, level-up and experience changes.

EventSubscriptionGroup

Tracks multiple subscriptions and unsubscribes them together for reloadable or optional systems.

Battles

BattleInspector

Read-only helpers for wild, trainer and PvP classification, actor filtering, player UUIDs, Pokémon extraction, faint events and victory participants.

BattleKind

High-level classification: WILD, TRAINER, PVP or OTHER.

Pokédex

PokedexQueries

Read-only helpers for seen/caught species, forms, aspects, shiny knowledge, counts and completion percentages.

Do not use internal packages.

Anything under com.ourstory.oscobblemon.internal can change or disappear without notice.

Practical examples

Common patterns

Preferred patterns for recurring Cobblemon integrations.

Resolve species IDs

Species species =
        PokemonSpeciesResolver.require(configuredSpecies);

Bare IDs default to the Cobblemon namespace while explicit addon namespaces are preserved.

Spawn without commands

PokemonCreation.spawnSpecies(
        level,
        position,
        configuredSpecies,
        rolledLevel,
        shiny
);

Complex properties can be passed directly:

PokemonCreation.spawn(
        level,
        position,
        "species=pikachu level=25 shiny=true"
);

Build a reusable matcher

PokemonMatcher matcher = PokemonMatcher
        .fromProperties("type=fire level=50")
        .alpha(false)
        .anyLabel(List.of("legendary", "mythical"));

Query player-owned Pokémon

Optional<Pokemon> first =
        PokemonStorage.findFirstOwned(player, matcher);

List<Pokemon> all =
        PokemonStorage.findAllOwned(player, matcher);

int count =
        PokemonStorage.countOwned(player, matcher);

Persistent Pokémon data

PokemonData.update(pokemon, "examplemod:quest_state", data -> {
    data.putBoolean("completed", true);
    data.putInt("attempts", data.getInt("attempts") + 1);
});

boolean completed = PokemonData.read(pokemon, "examplemod:quest_state")
        .map(data -> data.getBoolean("completed"))
        .orElse(false);

Type-based compatibility

boolean compatible = PokemonTypes.hasAnyType(
        pokemon,
        List.of("grass", "bug", "flying")
);

Lifecycle-safe event subscriptions

EventSubscriptionGroup subscriptions =
        new EventSubscriptionGroup();

subscriptions.track(
        CobblemonEventHooks.onCapture(this::handleCapture)
);

subscriptions.track(
        CobblemonEventHooks.onBattleVictory(this::handleVictory)
);

// Feature shutdown or reload:
subscriptions.close();

Battle progression

Pokemon defeated =
        BattleInspector.faintedPokemon(event);

if (BattleInspector.isWild(event.getBattle())) {
    // Wild battle progression.
}

boolean won =
        BattleInspector.didPlayerWin(event, player.getUUID());

Pokédex-aware behavior

if (PokedexQueries.hasSeen(player, pokemon)) {
    // Species has been encountered.
}

if (PokedexQueries.hasCaughtForm(player, pokemon)) {
    // Current form has been caught.
}
Keep the compatibility boundary clean.

When the same Cobblemon integration appears in multiple mods, prefer a focused library helper over copying the same implementation into every project.

Scope, stability & licensing

Compatibility

What the library supports, what it intentionally avoids, and which API guarantees consumers can rely on.

Current compatibility line

AreaCurrent target
Minecraft1.21.1
Cobblemon1.8.1 to <1.9.0
Fabric Loader0.17.2
Fabric API0.116.6+1.21.1
NeoForge21.1.182 minimum
Java21

In scope

  • Pokémon identity and reusable property access.
  • Species, forms, aspects, marks, types and size data.
  • Read-only Pokémon entity bridge helpers.
  • Party and PC access and lookups.
  • Cobblemon event integration.
  • Battle inspection and classification.
  • Pokédex queries.
  • Small adapters that isolate meaningful Cobblemon API changes.

Out of scope

  • Gameplay rules or progression systems specific to one mod.
  • Custom balancing formulas.
  • Mod-specific user interfaces or spawning systems.
  • Entity AI, movement, navigation or despawn systems.
  • Leaderboards and scoring systems.
  • Generic networking, permission, registry or configuration frameworks.

API stability

OS Cobblemon Library follows semantic versioning for its documented public API.

Release typeExpected API behavior
PatchBug fixes, docs and compatibility changes that preserve the public API.
MinorNew helpers, overloads or integration areas while preserving existing public API source compatibility.
MajorBreaking changes to the supported public API.

Internal API

com.ourstory.oscobblemon.internal

This package is not supported for consuming mods and may change without notice.

License

Public API use is allowed.

Independent mods may build and distribute against the documented public API without publishing their own source code. The OS Cobblemon Library implementation itself remains All Rights Reserved under its proprietary API license.

Redistribution, modified builds, rebranding and source-code reuse of the Library itself require separate permission from LevelsFR.

Release history

Changelog

Public release history for OS Cobblemon Library.

1.1.0 - 2026-09-18

Added

  • Persistent Pokémon data for storing custom mod data safely.
  • Reusable Cobblemon event hooks for captures, evolutions, battles, gimmicks, healing, fainting, sending, recalling, spawning and Pokédex updates.

1.0.1 - 2026-09-17

Added

  • Official OS Cobblemon Library logo in Fabric and NeoForge mod listings.

Changed

  • Updated the public mod description to better reflect the API and compatibility role.
  • Normalized in-game metadata text and resource processing to avoid accented-character encoding issues on Windows builds.
  • Clarified the proprietary license so third-party mods may use the documented public API without source-disclosure requirements while the Library itself remains protected.

1.0.0 - 2026-09-16

Added

  • Multi-loader Fabric and NeoForge project structure.
  • Pokémon identity, matching, species resolution and command-free creation helpers.
  • IV, ability, type and data-driven label helpers.
  • Native Pokémon size-category, translation-key and safe scale helpers.
  • Read-only PokemonEntity bridge helpers for Pokémon access, ownership and Cobblemon entity state.
  • Party and PC storage queries, matching and counts.
  • Cobblemon event subscription and lifecycle helpers.
  • Battle classification and event inspection helpers.
  • Pokédex species, form, variation and completion queries.
  • Local Maven development publishing.
  • Public integration, API stability and release documentation.

Changed

  • Runtime metadata explicitly targets Minecraft 1.21.1 and Cobblemon 1.8.x.
  • CI builds and Maven publication use the committed Gradle wrapper.
  • Architectury build plugins are pinned to reproducible versions.
  • Public API boundaries are documented and internal packages are excluded from the supported API.