Shop¶
Screaming BedWars plugin uses our own lib called SimpleInventories to create and render inventory-based guis, and therefore shops. This article will show you some basics of this format. Check this wiki for more advanced variables.
Creating a new item¶
To create a new item, first you need to know internal item's name. You can use Minecraft Wiki to get the specific resource name. The name usually starts with minecraft:
, this part can be omitted from the final name.
You can also use modern names in legacy environments (1.8.8-1.12.2). If the modern name does not work, check this page for old names. Old names are deprecated and they may not be supported in future releases of BedWars.
There are two supported formats of items. We call them short stack
and long stack
.
Using short stack¶
This format can describe only material name, amount, display name and lore. Except for material name, every part is optional. Each part is divided using semicolon.
1 2 3 4 5 |
|
To specify price and make the item buyable, suffix this format with for <amount> <resource>
:
1 2 3 4 5 |
|
In order to be able to specify other attributes (for example properties
), we have to convert this from string to map. This is done by splitting the string into variables stack
and price
:
1 2 3 4 5 6 7 8 9 |
|
Using long stack¶
Long stack allows you to create items with enchantments and other attributes. Let's see the previous example rewritten in this format:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
As we can see, the stack
attribute is now a map, which allows more attributes to be present. For example, we can enchant our Super Pickaxe with Fortune III.
1 2 3 4 5 6 |
|
The enchantment names can be found here.
For list of all available options visit this page.
Using item as a category¶
You can use any item as a category (even if the item is in another category). Players can then click on that item to open the category. The format is very similar, the only thing you have to specify is a list called items
, where you put items of that specific category. Format of items in items
is same as format in the base data
list.
1 2 3 4 5 6 7 8 |
|