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.
Player Functions
Section titled “Player Functions”- Functionq.player.market()
Returns the player's UUID
Returns{ "playerUUID": "string" } - Functionq.player.market.open()
Opens the market GUI for the player.
Returns1 for success, otherwise 0 - Functionq.player.market.open(<shopId string>)
Opens a specific shop GUI for the player.
Returns1 for success, otherwise 0
NPC Behaviors
Section titled “NPC Behaviors”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" ] } ]}Molang Scripts
Section titled “Molang Scripts”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.