Skip to content

Custom Biome Platforms

Every Pokémon in the PokéNav stands on a small biome platform that hints at where it lives. CobbleNav ships with plains, sand, stone, water and lava platforms, and you can add your own.

To add custom platforms, you will need a datapack and a resource pack. The datapack implements conditions under which a particular platform should be used, while the resource pack adds assets and configures rendering. In order to simplify distribution, the data pack and resource pack can be combined into a single archive, just as is usually done with add-ons for Cobblemon.

In this example, let’s take a look at the implementation of the lava platform.

The conditions are specified in a JSON file in data/<namespace>/biome_platforms/. The file can have any name, but for convenience, it is better to name it according to the unique ID of your platform.

data/cobblenav/biome_platforms/lava.json
{
"id": "cobblenav:lava",
"condition": {
"type": "surface",
"fluid": "#minecraft:lava"
}
}
Field Required Description
id Yes The platform ID. The resource pack side uses the same ID to find the textures.
condition Yes A Cobblemon spawning condition.
anticondition No A Cobblemon spawning condition that must not be met.

condition and anticondition use exactly the same format as the condition of a Cobblemon spawn file. The type field selects the kind of condition (grounded, submerged, surface, seafloor, fishing, …); without a type, a basic condition that works for every spawn position is used. All fields Cobblemon supports for that type can be used, such as biomes, structures, fluid, minY, minLight, timeRange, isRaining, neededNearbyBlocks and so on.

In accordance with these conditions, the platform with ID cobblenav:lava will be used when the Pokémon spawns on the surface of lava.

A grounded platform for grassland biomes looks like this:

data/cobblenav/biome_platforms/plains.json
{
"id": "cobblenav:plains",
"condition": {
"type": "grounded",
"biomes": [
"#cobblemon:is_plains",
"#cobblemon:is_grassland",
"#cobblemon:is_temperate"
]
}
}

And an anti-condition can exclude cases you do not want:

data/mypack/biome_platforms/snowy_forest.json
{
"id": "mypack:snowy_forest",
"condition": {
"type": "grounded",
"biomes": ["#cobblemon:is_forest"]
},
"anticondition": {
"biomes": ["#cobblemon:is_temperate"]
}
}

When the PokéNav calculates spawns, CobbleNav collects the positions around the player where each Pokémon could actually spawn. For each of those positions it looks at the platforms whose biomes match the biome at that position, and picks the first platform whose condition is met (and whose anti-condition is not). If no platform fits, the default platform is used.

Several files may share the same id. This is how the bundled cobblenav:water platform is used both for water biomes and for any spawn on or under water: it is defined in water.json, water_fluid_surface.json and water_fluid_submerged.json.

The client side of the platform is located at assets/<namespace>/biome_platforms/. The file can still have any name. Basically, only the root directory changes from data to assets. In the case of the lava platform, it looks like this:

assets/cobblenav/biome_platforms/lava.json
{
"id": "cobblenav:lava",
"platform": "cobblenav:textures/gui/biome_platforms/lava.png",
"platformHighlighting": {
"offset": {
"y": -2
}
},
"hoveredPokemonOffset": {
"y": -2
}
}

It is important to specify the same ID that was specified in the file with the conditions. The platform field specifies the namespace, followed by a colon and the path to the main platform sprite. This means the line cobblenav:textures/gui/biome_platforms/lava.png indicates that the file will be located at assets/cobblenav/textures/gui/biome_platforms/lava.png.

Field Description
id The platform ID from the data pack.
platform Texture drawn behind the Pokémon.
platformHighlighting Changes applied to the platform while its tile is hovered. See Hover highlighting.
details Optional texture drawn in front of the Pokémon, for example grass blades or bubbles.
detailsHighlighting Changes applied to the details texture while hovered.
hoveredPokemonOffset x/y offset (in pixels) applied to the Pokémon while hovered.

Platform and detail textures are drawn over the whole spawn tile, so use the size of the bundled textures as a template.

The platformHighlighting and detailsHighlighting objects accept any combination of these fields:

{
"offset": { "x": 0, "y": -2 },
"texture": "cobblenav:textures/gui/biome_platforms/lava_hovered.png",
"tintOffset": 0.2
}
Field Description
offset Shifts the texture by x/y pixels.
texture Replaces the texture while hovered.
tintOffset Brightens (positive) or darkens (negative) the texture. 0.2 makes it 20% brighter.

Details are a texture that will be displayed on top of the platform and the Pokémon model.

assets/cobblenav/biome_platforms/lava.json
{
...
"details": "cobblenav:textures/gui/biome_platforms/lava_details.png",
"detailsHighlighting": {
"offset": {
"y": -2
}
}
}
ID Used for
cobblenav:plains Grounded spawns in plains, grassland and temperate biomes
cobblenav:sand Grounded spawns in arid biomes
cobblenav:stone Grounded spawns in mountain biomes
cobblenav:water Spawns in freshwater, river and ocean biomes, and spawns on or under water
cobblenav:lava Spawns on the surface of lava

Spawns without a fitting platform use the default platform. Fishing spawns in the FishingNav always use a bubble platform.

To change the look of a built-in platform, override its file in assets/cobblenav/biome_platforms/ with a resource pack. To change when it is used, override its file in data/cobblenav/biome_platforms/ with a data pack.