LK Shop&Market 0.3.0
All Rights Reserved
Copyright (c) 2026 Nek4z. All rights reserved.

This mod cannot be opened or modified without explicit authorization from the author (LK Shop&Market).

You may NOT, without written permission from the author:
  - decompile, disassemble or reverse engineer this file
  - modify, patch or repackage it
  - redistribute it, in whole or in part, modified or unmodified
  - include it in a modpack hosted outside the official download pages

You MAY install and run it on your own client or server, private or public.

Official downloads are the only ones supported. A copy obtained anywhere else may
have been altered and is not covered by any support or update.

Contact the author for licensing, modpack or redistribution requests.


------------------------------------------------------------------------------
TRANSLATING THE MOD
------------------------------------------------------------------------------

Translations are welcome and are the one contribution that needs no permission.
The mod ships English (en_us) and Spanish (es_es).

1. Open this jar with any zip tool and go to:

       assets/lkshopmarket/lang/

2. Copy  template.json  and rename the copy to your locale code, lowercase:

       de_de.json   German
       fr_fr.json   French
       pt_br.json   Brazilian Portuguese
       ru_ru.json   Russian
       zh_cn.json   Simplified Chinese

   The full list of codes is the same one Minecraft uses in its language menu.

3. Translate the VALUE of every line. Never touch the key on the left.

       "gui.lkshopmarket.tab.explore": "Browse"      <- translate "Browse" only

4. Rules that matter:

   - Keep %s exactly as it is, and keep the SAME NUMBER of them per line.
     They are replaced at runtime with an amount, a name or an item. A missing
     %s crashes that message; an extra one shows literal text.
   - Where several %s appear in one line, their order is fixed by the code.
     If your language needs a different order, use %1$s, %2$s and so on.
   - Do not translate anything that starts with a slash. Command names such as
     /market or /market admin shop create are typed literally by the player.
   - Keep every key. A missing key shows the raw key on screen, which looks
     broken. If you are unsure of a line, leave the English text.
   - Save the file as UTF-8 without BOM.

5. Test it: put the file back in the jar (or in a resource pack under the same
   path) and set that language in Minecraft.

Send the finished file to the author and it ships in the next release, credited.
The template is regenerated on every release, so re-check it after an update to
pick up new keys.


------------------------------------------------------------------------------
SERVER SHOPS FROM A DATAPACK
------------------------------------------------------------------------------

A shop built with /market admin shop create lives inside the world save. That is
fine for one server, but it cannot be version controlled, copied to another
world or rebuilt on a fresh map without redoing every entry by hand.

A shop can also be a file in a datapack:

    data/<your_namespace>/lkshopmarket/shops/<shop_id>.json

The file name is the shop id, so blacksmith.json is opened with
/market go blacksmith and linked to a villager with
/market admin shop link blacksmith.

    {
      "title": "Blacksmith",
      "permission_level": 0,
      "entries": [
        {
          "item": "minecraft:iron_ingot",
          "buy": 25,
          "sell": 10,
          "stock": -1
        },
        {
          "item": "minecraft:diamond_sword",
          "buy": 900,
          "sell": 300,
          "stock": 3,
          "nbt": "{Enchantments:[{id:\"minecraft:sharpness\",lvl:3s}]}"
        }
      ]
    }

    title             Name shown above the GUI. Optional, defaults to the id.
    permission_level  Operator level needed to open it. 0 (or missing) is open
                      to everyone, which is what every in game shop gets.
    item              Item id. Required.
    buy               What the PLAYER pays to buy one from the server.
    sell              What the SERVER pays to buy one from the player.
                      At least one of the two must be above 0, and sell can
                      never exceed buy: a server that pays more than it charges
                      is an infinite money loop. An entry that breaks this is
                      skipped and the reason is written to the server log.
    stock             Units available. -1 or missing means unlimited.
    nbt               Optional SNBT, for enchanted or otherwise tagged items.

Run /reload to pick up changes without restarting.

Two things to know before choosing this over an in game shop:

  - The file is the source of truth, so stock and any dynamic price drift go
    back to what the file says on every /reload and every restart. A shop whose
    stock has to survive a restart should be created in game instead.
  - Its catalog cannot be edited from the GUI editor or the entry commands. The
    change would look like it worked and then disappear on the next reload, so
    it is refused with an explanation instead.

If a datapack and the world both declare the same id, the world shop wins and
/market admin shop list marks which is which.
