Adding Buy or Sell Recipes (JSON) - AmmoniumX/AdminShop GitHub Wiki
You can add buy or sell offers as JSON recipes, either by creating your own datapack and adding new JSON recipes, or with KubeJS. KubeJS is the recommended approach for modpack developers.
There are four different recipe types:
adminshop:item_buying
adminshop:item_selling
adminshop:fluid_buying
adminshop:fluid_selling
Item buy offers add a new item in the shop's "buy" section. It specifies which item you are buying and the item's price.
{
"type": "adminshop:item_buying",
"price": <long>,
"permit": <string> (optional),
"result": {
"item": <string>,
"nbt": <string> (optional),
"count": <int> (optional)
}
}
Example:
{
"type": "adminshop:item_buying",
"price": 100,
"permit": "special",
"result": {
"item": "minecraft:paper",
"nbt": "{display:{Name:'{\"text\":\"Special Paper!\"}'}}",
"count": 4
}
}
Notes:
- Item buy offers do not support item tags such as
forge:ingots/iron
- The
permit
,nbt
, andcount
fields are optional
Item sell offers add a new item in the shop's "sell" section. It specifies the item you are selling and its value.
{
"type": "adminshop:item_selling",
"price": <long>,
"permit": <string> (optional),
"input": {
"item": {
"item": <string>,
"nbt": <string> (optional),
"count": <int> (optional)
}
}
}
{
"type": "adminshop:item_selling",
"price": <long>,
"permit": <string> (optional),
"input": {
"tag": {
"tag": <string>,
"nbt": <string> (optional),
"count": <int> (optional)
}
}
}
Examples:
{
"type": "adminshop:item_selling",
"price": 100,
"input": {
"tag": {
"tag": "minecraft:wool",
"count": 16
}
}
}
{
"type": "adminshop:item_selling",
"price": 100,
"input": {
"item": {
"item": "minecraft:paper",
"count": 4,
"nbt": "{display:{Name:'{\"text\":\"Special Paper!\"}'}}"
}
}
}
Notes:
- The
permit
,nbt
, andcount
fields are optional - The
tag
field doesn't include a#
prefix (useforge:ingots
instead of#forge:ingots
)
Fluid buy offers add a new fluid in the shop's "buy" section.
{
"type": "adminshop:fluid_buying",
"price": <long>,
"permit": <string> (optional),
"result": {
"fluid": <string>,
"amount": <int> (optional)
}
}
Example:
{
"type": "adminshop:fluid_buying",
"price": 100,
"result": {
"fluid": "minecraft:water",
"amount": 1000
}
}
Notes:
- The
permit
field is optional - The
amount
field is optional and defaults to 1000 mB (1 bucket) if not specified
Fluid sell offers add a new fluid in the shop's "sell" section.
{
"type": "adminshop:fluid_selling",
"price": <long>,
"permit": <string> (optional),
"result": {
"fluid": <string>,
"amount": <int> (optional)
}
}
Example:
{
"type": "adminshop:fluid_selling",
"price": 100,
"result": {
"fluid": "minecraft:lava",
"amount": 1000
}
}
Notes:
- The
permit
field is optional - The
amount
field is optional and defaults to 1000 mB (1 bucket) if not specified