Skip to content

Cobbled Market - NPC Extensions

Cobbled Market includes extensions for Cobblemon NPCs, allowing them to interact with PokeTotems in various ways. These extensions can be used to create custom NPC dialogues and interactions involving PokeTotems.

  • Function
    q.player.market()

    Returns the player's UUID

    Returns { "playerUUID": "string" }
  • Function
    q.player.market.open()

    Opens the market GUI for the player.

    Returns 1 for success, otherwise 0
  • Function
    q.player.market.open(<shopId string>)

    Opens a specific shop GUI for the player.

    Returns 1 for success, otherwise 0

The cobbled_market:market_keeper behaviour is provided for use with Cobblemon NPCs. It can be used to create a market NPC that opens the shop directory or a specific shop when interacted with.

In your NPC’s configuration, add the following:

{
...other npc config options...,
"ai": [
{
"type": "apply_behaviours",
"behaviours": [
...other behaviours...,
"cobbled_market:market_keeper"
]
}
]
}

The behaviour above uses the following Molang scripts to determine which shop to open when the NPC is interacted with.

  • cobbled_market:market_keeper_interaction - Simple script that checks for a shop ID in the NPC’s data and opens that shop if it exists.