Skip to content

Presets

To make configuring shops easier, you can create Shop Entry Presets, which allow you to reuse the same configuration for multiple Shop Entries without having to copy and paste the same configuration details multiple times. This also makes editing a price for a given preset much easier as the price will be reflected everywhere the preset is used.

Each Preset configuration is stored in either its own JSON file or together in JSON files within the presets folder inside the main /config/skiesshops/ folder.

  • Directoryconfig
    • Directoryskiesshop
      • Directorypresets
        • dirt_preset.json
        • many_presets.json

Each Preset can be stored in its own JSON file with the preset ID as the file name:

  • Directoryconfig
    • Directoryskiesshop
      • Directorypresets
        • example_preset.json
{
"type": "ITEM",
"item": "minecraft:diamond",
"buy": {
"price": 1,
"economy": "IMPACTOR",
"currency": "impactor:dollars"
},
"sell": {
"price": 1,
"economy": "IMPACTOR",
"currency": "impactor:dollars"
}
}

This setup would result in a preset with the ID example_preset of type ITEM with the specified buy/sell prices.

Alternatively, multiple presets can be stored together in a single JSON file as a MAP of preset ID to preset configuration:

  • Directoryconfig
    • Directoryskiesshop
      • Directorypresets
        • many_presets.json
{
"example_preset": {
"type": "ITEM",
"item": "minecraft:diamond",
"buy": {
"price": 1,
"economy": "IMPACTOR",
"currency": "impactor:dollars"
},
"sell": {
"price": 1,
"economy": "IMPACTOR",
"currency": "impactor:dollars"
}
},
"second_preset": {
"type": "COMMAND",
"command": "/give @p minecraft:diamond",
"buy": {
"price": 1,
"economy": "IMPACTOR",
"currency": "impactor:dollars"
}
}
}

This setup would result in two presets with the IDs example_preset and second_preset with their respective configurations.

To use a preset in a Shop Entry, simply set the entry’s type to PRESET and it will use the ID of the entry as the desired preset. For example, with the above example_preset, you could create a Shop Entry like this:

"example_entry": {
"type": "PRESET"
}

This will effectively copy the configuration from the example_preset preset into this Shop Entry, so it will be an ITEM type entry that sells/buys diamonds for 1 dollar.