Skip to content

About

Send Pokémon between Pixelmon and Cobblemon servers, or migrate a whole server. Signed parcels, claimed once. Unofficial addon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Get Pebble Post on Modrinth Latest GitHub release

Download: Modrinth · GitHub releases

Pebble Post: send Pokémon between Pixelmon and Cobblemon servers

Works with: Pixelmon · Cobblemon · NeoForge · Fabric

Pebble Post moves Pokémon from one Minecraft server to another, including between Pixelmon and Cobblemon. A player posts a Pokémon on one server. It leaves their party at once and becomes a parcel file signed by that server. They claim it on the other server. The parcel can be claimed only once, only on servers that trust the signing server, and the claim report shows anything that didn't carry over.

It is also a migration tool. An admin can export every player's party and PC in one command, move the files to the new server, and have everyone's Pokémon waiting for them when they log in.

Pebble Post is a mod for Minecraft 1.21.1. One jar works on every supported setup:

Loader Works with Also needs
NeoForge 21.1 Pixelmon 9.4.2 or later, or Cobblemon 1.8 or later Kotlin for Forge, if you use Cobblemon
Fabric (loader 0.16 or later) Cobblemon 1.8 or later Fabric API

The jar works out which Pokémon mod is installed when the server starts. If NeoForge has both installed, it uses Pixelmon. On Fabric, Forge Config API Port is bundled inside the jar, so there is nothing else to install.

It runs only on the server. The menus are ordinary chest menus, so players don't need to install anything.

Unofficial addon. Pebble Post is a fan-made addon. It is not made by, affiliated with, or endorsed by the Pixelmon team, the Cobblemon team, Nintendo, Game Freak or The Pokémon Company.

Contents

How it works

Sending

  1. Run /pebblepost and click Send, or run /pebblepost send.
  2. Pick a Pokémon from your party, or click PC to pick from a box.
  3. Confirm. The Pokémon leaves your storage right away. A parcel addressed to you is written to the server's outbox.

Picking a Pokémon to send Confirming the send

Claiming

  1. The parcel file reaches the other server's inbox. An admin copies it there, or both servers share one folder (see Setting up two servers).
  2. On that server, run /pebblepost inbox. Each parcel shows where it came from, when it was sent, and whether its signature is from a trusted server.
  3. Open a parcel to see each Pokémon as it will arrive. Anything that won't come through is listed there too. Click Claim.

The inbox, accepting parcels A parcel from a Pixelmon server, previewed on a Cobblemon server and signed by a trusted key

When a claim goes through, the chat lists every change and loss:

Claim report: held item mapped, growth shown as scale, move reminder lost

Nothing is changed silently. A claim has three kinds of report line:

  • Note: the value is carried over in a different form. For example, pixelmon:leftovers becomes cobblemon:leftovers, or a Pixelmon growth becomes a Cobblemon scale.
  • Lost: the value has no equivalent here and was dropped.
  • Refused: the Pokémon can't come in at all. The parcel stays in the inbox, and the menu says why.

A parcel signed by an untrusted key An inbox on a server that is not accepting parcels

What carries over

Each Pokémon travels in a neutral format, described in The file format. It also carries the source mod's own save data. When a Pokémon arrives on a server running the same mod, it is restored exactly from that data, by default.

Kept between Pixelmon and Cobblemon

Field Notes
Species and form Regional forms (Alolan, Galarian, Hisuian, Paldean) and other permanent forms, such as Rotom's appliance forms. If the other mod has no such form, the Pokémon arrives in its base form, with a note.
Pixelmon palettes and Cobblemon aspects Matched by name where both mods have the look. For example, Vivillon's icy_snow palette in Pixelmon becomes the Icy Snow form in Cobblemon, and back again.
Shiny, gender, nickname Gender is fixed if the species can't have it, with a note.
Level and experience Lowered to the server's level cap, with a note.
IVs, EVs, hyper training Values are kept within the legal limits, with a note if any value had to change.
Nature, mint nature
Ability, including whether it is the hidden ability If the ability isn't one of the species' abilities on the other mod, it gets a legal one, with a note.
Moves and PP Ups Moves the other mod doesn't have are dropped, with a note.
Friendship, Poké Ball, original trainer
Held item The namespace changes where the item exists in the other mod (pixelmon:leftovers ↔ cobblemon:leftovers). Vanilla and other mods' items keep their id and data. If there is no such item, the held item is lost, with a note.
Size Pixelmon growth and Cobblemon scale are converted to the closest match, with a note.
Tera Type, Gigantamax factor

With pixelpebbles_palettes on, Pokémon arriving on Pixelmon from Cobblemon get the PixelPebbles cobblemon palette (or cobblemon_shiny) where the species has one. That keeps their Cobblemon look.

Not carried over

These are reported, never dropped silently.

Lost going to Cobblemon Lost going to Pixelmon
Eggs: Cobblemon has no eggs, so an egg parcel is refused and stays claimable on a Pixelmon server Status conditions, alpha, marks and the active mark, PC markings
The move reminder (moves it can relearn) Benched moves (moves it can relearn)
Pixelmon-only flags and data Pending evolutions and evolution progress
Dynamax level, cosmetic item, riding stat boosts
Species features that aren't aspects, and aspects Pixelmon has no palette for
Data other mods stored on the Pokémon

The source mod's own data travels in the parcel. The losses above apply only when the Pokémon crosses to the other mod. A Pixelmon Pokémon that goes to Cobblemon and comes back as a new parcel is rebuilt from the neutral fields.

Every claimed Pokémon is healed on arrival. Arrivals are not added to Pixelmon's Pokédex. On Cobblemon, the Pokédex is updated only for players who are online when their Pokémon arrives.

Security model

Pebble Post is built so that a Pokémon can't be duplicated or forged, even by someone who can edit files.

  • Sending removes the Pokémon from the source first. The parcel is written to a temporary file and synced to disk. Then the Pokémon is removed and the player's storage is saved. Only then is the file renamed to a parcel.
    • If saving fails, the Pokémon is put back.
    • If the server crashes part-way, the next start finishes the job. A leftover temporary file becomes a parcel only if its Pokémon really left.
  • Every parcel is signed. Each server makes an Ed25519 key pair on first start, in pebblepost/keys/.
    • The signature covers the whole parcel, so changing any byte breaks it.
    • Changed parcels are hidden from players, and admins see them flagged in /pebblepost inspect.
    • server.key never leaves the server. Back it up, and never share it.
  • Imports are off by default, and only trusted keys are accepted. A server takes parcels only after an admin turns imports on and adds the other server's public key to trusted_keys. A parcel signed by any other key is refused, including one signed by this server, unless you trust it yourself.
  • Each parcel can be claimed once, and each migration once. Every claim is recorded in an append-only ledger (pebblepost/ledger.jsonl), with a file lock, before the Pokémon is stored.
    • A copy of an already-claimed parcel is refused, and the menu shows who claimed it, where and when.
    • A player can claim one migration per source server. A second export of the same account is refused, so a migration run twice can't double anyone's Pokémon.
    • The ledger is per server. If several servers import from one shared inbox, point them all at one shared ledger_file, or the same parcel could be claimed once on each.
    • Never delete the ledger.
  • Blacklists on both ends. The sending blacklist stops players posting certain Pokémon. The receiving blacklist is checked on the Pokémon as it would arrive here, so a mapped or changed Pokémon can't slip past it.
  • Everything is checked on the server, at claim time. Imports enabled, signature, trusted key, recipient, expiry, blacklist and free space are all checked again when Claim is clicked, not only when the menu opens. Players can claim only parcels addressed to them.
  • Logs. Every send and claim is written to pebblepost/logs/sent.log and claims.log.

recipient_match = "uuid" is the safe choice for online-mode servers. Use "name" only for offline-mode servers, where a player's UUID differs from server to server.

Setting up two servers

The example sends from a Pixelmon server, old, to a Cobblemon server, new. It works the same in the other direction, or between two servers running the same mod.

  1. Install the jar on both servers and start them once.

  2. On each server, set server_name in config/pebblepost-common.toml.

  3. On old, run /pebblepost key and copy the key it prints. It starts with pp1:.

  4. On new, run /pebblepost trust add old pp1:..., then /pebblepost imports on. Run /pebblepost status to check.

  5. Get parcels from old's outbox (pebblepost/outbox/) to new's inbox (pebblepost/inbox/). Either:

    • copy the files across by hand, with a script, or with a sync tool; or
    • point old's outbox_folder and new's inbox_folder at one shared folder.

    Parcels are plain files, so they don't need to fit in a command or a chat message. Subfolders of the inbox are read too. Claimed parcels move to inbox/claimed/.

For a network of servers that share one folder, add every server's key to every server, including each server's own key, and share one ledger_file.

Migrating a whole server

  1. On the old server, run /pebblepost migrate export all, or /pebblepost migrate export <players>.
    • This exports the party and every PC box of every player the server knows, online or not.
    • Each player gets one parcel in pebblepost/outbox/migration-<date>/.
    • The Pokémon also stay on the old server, so you can check the export before you switch over. Shut the old server, or stop players joining it, before anyone claims on the new one.
  2. Copy that folder into the new server's inbox, and trust the old server's key there.
  3. With auto_claim_migrations on (the default), each player's Pokémon are claimed for them about three seconds after they log in. Pokémon go back to the same party slot and PC box slot where there is room. Alternatively, run /pebblepost migrate import to claim every migration parcel now, for online and offline players alike.

With migration_skip_refused on (the default), a Pokémon the new server can't take doesn't hold up the rest of the account. This covers blacklisted species, eggs on Cobblemon, and species the server doesn't have. That Pokémon is recorded in pebblepost/refused/<parcel id>.json with the reason, and everything else is stored.

Each player can claim only one migration from each source server. If an export is run twice, the second parcel is refused ("already moved in a migration from that server"), because the old server kept its Pokémon and both parcels hold the same ones. If a migration really should come in again, release the first claim with /pebblepost ledger release <id>.

Offline players whose name the server has never cached show up under their UUID in file names and messages. Claims match by UUID, so this does no harm.

Commands

Player commands need player_permission_level (default 0, everyone). Admin commands need admin_permission_level (default 3).

Command Who What it does
/pebblepost player Opens the main menu: send, a short help page, and the inbox.
/pebblepost send player Opens the send menu.
/pebblepost inbox player Opens the inbox of parcels addressed to you.
/pebblepost status admin Shows the server name, key fingerprint, imports on or off, trusted keys, ledger size and folders.
/pebblepost key admin Prints this server's public key, to trust it on another server.
/pebblepost trust list admin Lists trusted keys.
/pebblepost trust add <name> <key> admin Trusts a server's key, and saves it to the config.
/pebblepost trust remove <name> admin Stops trusting a key.
/pebblepost imports [on|off] admin Shows, or turns on or off, whether this server accepts parcels.
/pebblepost inspect [file] admin Lists every inbox parcel and what is wrong with it (bad signature, untrusted, claimed, expired), or shows one parcel in full with its arrival report.
/pebblepost ledger show <id> admin Shows the ledger record of one parcel.
/pebblepost ledger pending admin Lists claims that were started and never finished, for example after a crash.
/pebblepost ledger release <id> admin Releases a pending claim, so the parcel can be claimed again. Check first that the Pokémon didn't arrive.
/pebblepost migrate export all admin Exports every player's party and PC. The Pokémon stay on this server too.
/pebblepost migrate export <players> admin Exports some players' party and PC, the same way.
/pebblepost migrate import admin Claims every migration parcel in the inbox, for online and offline players alike.
/pebblepost dump <player> <slot> admin Prints a party Pokémon in the transfer format, with its report, without sending it.
/pebblepost reload admin Re-reads the folders, the ledger path and the lang file.

All text players see is in assets/pebblepost/lang/en_us.json. To reword or translate any of it, put the keys you want to change in config/pebblepost/lang.json.

Config

The config is config/pebblepost-common.toml. It is created on first start, and changes are picked up while the server runs.

[general]

Option Default What it does
server_name "my-server" The name written on every parcel this server sends.
admin_permission_level 3 Permission level for the admin commands.
player_permission_level 0 Permission level for /pebblepost, send and inbox.
outbox_folder "pebblepost/outbox" Where parcels are written. Relative to the server folder, or absolute.
inbox_folder "pebblepost/inbox" Where parcels are read from, subfolders included.
ledger_file "pebblepost/ledger.jsonl" The claim ledger. Share one between servers that share an inbox.

[sending]

Option Default What it does
enabled true Whether players can send Pokémon.
allow_pc true Whether players can send from their PC as well as their party.
allow_eggs true Whether eggs can be sent. A Cobblemon server can't take them, but a Pixelmon server can.
allow_untradeable false Whether Pokémon the mod marks untradeable can be sent.
expiry_days 0 Days a parcel can be claimed for. 0 means never expire.
blacklist [] Pokémon players can't send.

[receiving]

Option Default What it does
imports_enabled false Whether this server accepts parcels at all.
trusted_keys [] "<name> <key>" for each server whose parcels are accepted.
blacklist [] Pokémon this server won't take in, checked as they would arrive.
recipient_match "uuid" "uuid" or "name": how a parcel's recipient is matched to a player.
use_native_data true Restore same-mod Pokémon exactly from that mod's own data.
pixelpebbles_palettes true Pixelmon only: give arrivals from Cobblemon the PixelPebbles cobblemon palette where one exists.
auto_claim_migrations true Claim migration parcels for players as they log in.
migration_skip_refused true In migrations, store what can come in and record what can't, instead of refusing the whole account.
max_parcel_kb 16384 Largest parcel file read, in KiB.

A blacklist entry is one of:

  • a species name, like "mewtwo";
  • a label after #, like "#legendary", "#mythical", "#ultra_beast" or "#paradox";
  • spec: and a Pixelmon spec or Cobblemon properties string, like "spec:shiny".

The file format

A parcel is a UTF-8 JSON file ending .pebble.json. The outside is an envelope:

{
  "pebblepost": 1,
  "key": "pp1:<the sending server's Ed25519 public key, base64url>",
  "signature": "<Ed25519 signature, base64url>",
  "payload": "<the parcel, as a JSON string>"
}

The signature covers the bytes of "pebblepost-v1\n" + payload. A key's fingerprint, shown in menus and commands, is the first 12 hex digits of the SHA-256 of its key text.

The payload is the parcel:

{
  "format": "pebblepost-parcel",
  "version": 1,
  "id": "079eb6e3-8118-4ea1-a5a9-b29f9f75e1a2",
  "kind": "send",
  "issuedAt": 1795910678993,
  "expiresAt": 0,
  "origin": { "server": "old", "platform": "cobblemon", "platformVersion": "1.8.4", "minecraft": "1.21.1", "pebblePost": "1.0.0" },
  "recipient": { "uuid": "…", "name": "Alex" },
  "entries": [ { "box": null, "slot": null, "mon": { } } ],
  "notes": [ "what the sending server already knew wouldn't map" ]
}

kind is send (one Pokémon) or migration (a whole account, each entry with its PC box and slot, or party slot). Times are Unix milliseconds.

Each mon is one Pokémon in the neutral format, version 1. Ids are lower-case Showdown-style ids, without spaces or punctuation:

{
  "species": { "dex": 38, "id": "ninetales" },
  "form": "alola",
  "formNative": "Alola",
  "level": 40,
  "levelExp": 0,
  "ivs": { "hp": 31, "atk": 0, "def": 31, "spa": 31, "spd": 31, "spe": 31 },
  "hyperTrained": [],
  "evs": { "hp": 4, "atk": 0, "def": 0, "spa": 252, "spd": 0, "spe": 252 },
  "nature": "timid",
  "mintNature": null,
  "ability": { "id": "snowwarning", "hidden": true },
  "moves": [ { "id": "blizzard", "ppUps": 3 }, { "id": "moonblast", "ppUps": 0 } ],
  "friendship": 200,
  "shiny": true,
  "gender": "female",
  "ball": "ultra_ball",
  "nickname": "Frost",
  "originalTrainer": { "name": "Alex", "uuid": "…" },
  "heldItem": { "id": "cobblemon:light_clay", "count": 1, "components": null },
  "size": { "scale": 1.0, "growth": null },
  "palette": null,
  "aspects": [],
  "teraType": "ice",
  "gmaxFactor": false,
  "egg": null,
  "originalUuid": "…",
  "nativeData": { "platform": "cobblemon", "version": "1.8.4", "snbt": "<the mod's own save data>" },
  "unmapped": [ "mark:mark_lunchtime" ],
  "extra": {}
}
  • form is the neutral form id: empty for the base form, or alola, galar, wash and so on. formNative is the source mod's own name for it.
  • size has a Cobblemon scale, or a Pixelmon growth, or both.
  • palette is a Pixelmon palette, and aspects are Cobblemon aspects that aren't already covered by the form, gender or shininess.
  • egg is { "cyclesLeft": n } for an egg, else null.
  • unmapped names everything the source had that has no field here. It is the machine-readable side of the report.
  • extra is reserved for later versions. Readers ignore fields they don't know.

Building

You need JDK 21.

./gradlew build

The jar for every loader is written to build/libs/pebblepost-<version>.jar.

Pixelmon and Cobblemon are compile-only dependencies, downloaded from the Modrinth Maven. Neither is included in this repository or in the jar.

To try it in a dev client:

./gradlew :neoforge:runClientPixelmon      # NeoForge with Pixelmon, game folder run/pixelmon
./gradlew :neoforge:runClientCobblemon     # NeoForge with Cobblemon and Kotlin for Forge, game folder run/cobblemon
./gradlew :neoforge:runServerPixelmon      # a NeoForge server with Pixelmon, folder run/pixelmon-server
./gradlew :fabric:runProductionClient      # Fabric with Fabric API, Fabric Language Kotlin and Cobblemon, game folder run/fabric

The Fabric client is a production client, so nothing is remapped while it runs. Cobblemon doesn't start in Loom's ordinary dev client.

How it fits together

  • common/: everything that doesn't depend on the loader.
    • format/: MonData (the neutral format) and Report (notes, losses and refusals).
    • post/: Envelope (signing), Keys, Ledger, Parcel and PostOffice, which holds every rule about sending and claiming.
    • platform/: the small interfaces each Pokémon mod is written against.
    • cobblemon/: the Cobblemon backend, shared by both loaders.
    • menu/, command/, config/: the chest menus, /pebblepost and the config.
  • neoforge/: the NeoForge entry point, and the Pixelmon backend (Pixelmon is NeoForge-only).
  • fabric/: the Fabric entry point. The Fabric half of the jar is relocated to its own package, so both halves can live in one jar.
  • tools/: the logo and the README banner, as HTML (see tools/README.md).

More from WhosThatDeveloper

  • TinkerTokens: single-use tokens that change one thing about a Pokémon (shiny, nature, IVs, ball and more). One jar for Pixelmon or Cobblemon.
  • PixelPebbles: converts Cobblemon's Pokémon models into models Pixelmon can load, with matching cobblemon palettes.

Licence

Mozilla Public License 2.0.

Pixelmon, Cobblemon and Pokémon are the property of their respective owners. This project uses no code or assets from either mod; it talks to them only through their public APIs at runtime.

About

Send Pokémon between Pixelmon and Cobblemon servers, or migrate a whole server. Signed parcels, claimed once. Unofficial addon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages