Permits - AmmoniumX/AdminShop GitHub Wiki
Adding custom Permits
Permits are special items that can be "redeemed" on the Shop, to unlock access to restricted recipes. These can be great if you want to "gatekeep" certain shop offers behind progression.
Permits must be an item adminshop:permit
, with a NBT value {key:"something"}
. In this example, something
is the "permit ID". Any shop buy/sell recipe with said permit ID will be unusable by default, and only after redeeming a permit with {key:"something"}
will they become usable by the account.
These permits must have a language entry to be displayed inside GUIs. For example, for the permit ID "something", the language entry must be adminshop.permit.something
.
Adding a Permit via KubeJS
Here is a simple example setup for adding a Permit with ID "gems" via KubeJS.
Place this script inside kubejs/server_scripts
to add a recipe for the permit:
ServerEvents.recipes(event => {
event.shaped(Item.of('adminshop:permit', "{key:\"gems\"}"),
[
'AAA',
'ABA',
'AAA'
],{
A: 'minecraft:diamond',
B: 'minecraft:paper'
}
)
})
Then, place this script inside kubejs/client_scripts
to add the language entry:
ClientEvents.lang('en_us', event => {
event.add('adminshop.permit.gems', 'Rare Gems')
})