You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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](https://github.com/ScreamingSandals/SimpleInventories/wiki) for more advanced variables.
3
+
The Screaming BedWars plugin uses our custom library, **SimpleInventories**, to create and render inventory-based GUIs, including shops. This article covers the basics of the shop item format. For more advanced features, see the [SimpleInventories Wiki](https://github.com/ScreamingSandals/SimpleInventories/wiki).
4
4
5
5
## Creating a new item
6
6
7
-
To create a new item, first you need to know internal item's name. You can use [Minecraft Wiki](https://minecraft.wiki) to get the specific resource name. The name usually starts with `minecraft:`, this part can be omitted from the final name.
7
+
To create a new item, you need to know the item's internal name. You can look it up on the [Minecraft Wiki](https://minecraft.wiki). The name usually starts with `minecraft:`, but this prefix can be omitted.
8
8
9
-
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](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) for old names. Old names are deprecated and they may not be supported in future releases of BedWars.
9
+
In legacy environments (1.8.8–1.12.2), you can also use modern names. If they don’t work, refer to [this page](https://helpch.at/docs/1.12.2/org/bukkit/Material.html) for old material names. Keep in mind that old names are deprecated and may not be supported in future BedWars releases.
10
10
11
-
There are two supported formats of items. We call them`short stack` and `long stack`.
11
+
There are two supported formats for defining items:`short stack` and `long stack`.
12
12
13
13
### Using short stack
14
14
15
-
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.
15
+
The short stack format supports only the material name, amount, display name, and lore. Except for the material, all parts are optional and separated by semicolons (`;`).
16
16
17
17
```yaml
18
18
items:
@@ -22,7 +22,7 @@ items:
22
22
- tnt;3;Trinitrotoluene;Does explode
23
23
```
24
24
25
-
To specify price and make the item buyable, suffix this format with`for <amount> <resource>`:
25
+
To make the item purchasable, add`for <amount> <resource>`:
26
26
27
27
```yaml
28
28
items:
@@ -32,7 +32,7 @@ items:
32
32
- tnt;3;Trinitrotoluene;Does explode for 9 iron
33
33
```
34
34
35
-
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`:
35
+
In order to use additional attributes (like `properties` used for [Special items](specials.md)), simply convert the string format into a map with `stack` and `price` keys:
36
36
37
37
```yaml
38
38
items:
@@ -48,7 +48,9 @@ items:
48
48
49
49
### Using long stack
50
50
51
-
Long stack allows you to create items with enchantments and other attributes. Let's see the previous example rewritten in this format:
51
+
The long stack format allows full control over the item—enchantments, lore, display name, etc.
52
+
53
+
Let's see the previous example rewritten using long stacks:
52
54
53
55
```yaml
54
56
items:
@@ -72,7 +74,7 @@ items:
72
74
price: 9 iron
73
75
```
74
76
75
-
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.
77
+
Now, let's enchant our Super Pickaxe with Fortune III.
76
78
77
79
```yaml
78
80
- stack:
@@ -83,13 +85,13 @@ As we can see, the `stack` attribute is now a map, which allows more attributes
83
85
price: 5 gold
84
86
```
85
87
86
-
The enchantment names can be found [here](https://www.digminecraft.com/lists/enchantment_list_pc.php).
88
+
For enchantment names, refer to [this list](https://www.digminecraft.com/lists/enchantment_list_pc.php).
87
89
88
-
For list of all available options visit [this page](https://github.com/ScreamingSandals/SimpleInventories/wiki/Variable:-stack).
90
+
See [this page](https://github.com/ScreamingSandals/SimpleInventories/wiki/Variable:-stack) for a complete list of available options.
89
91
90
92
## Using item as a category
91
93
92
-
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.
94
+
You can use any item as a category entry (even if the item is in another category). When players click the item, it opens the corresponding subcategory. This is simply done by adding a new list to our item called `items`. The format of `items` inside a categoryis the same as in the base `data` list.
93
95
94
96
```yaml
95
97
- stack:
@@ -101,3 +103,141 @@ You can use any item as a category (even if the item is in another category). Pl
101
103
- wooden_pickaxe for 10 gold
102
104
- golden_pickaxe for 20 gold
103
105
```
106
+
107
+
## Custom items
108
+
109
+
Sometimes, you may want to sell items that cannot be represented with long stack options alone. In such cases, use the `tag` field to define additional item data using SNBT (stringified NBT) format.
110
+
111
+
Example:
112
+
113
+
```yaml
114
+
- stack:
115
+
type: diamond_pickaxe
116
+
tag: '{Enchantments:[{lvl:3,id:fortune}]}'
117
+
```
118
+
119
+
This creates a diamond pickaxe with Fortune III. Keep in mind the tag format depends on the Minecraft version.
120
+
121
+
### Tag in newer versions
122
+
123
+
Since Minecraft 1.20.5, item data uses the new data components format. Here's how the same pickaxe would be defined in Minecraft 1.21.4:
124
+
125
+
```yaml
126
+
- stack:
127
+
type: diamond_pickaxe
128
+
tag: '{enchantments:{levels:{fortune:3}}}'
129
+
```
130
+
131
+
Note that this SNBT format required by `tag` differs slightly from the command format nowadays used in-game:
2. Replace `[` at the beginning with `{` and `]` at the end with `}`:
144
+
```
145
+
{enchantments={levels:{fortune:3}}}
146
+
```
147
+
3. Replace all top-level `=` signs with `:`:
148
+
```snbt
149
+
{enchantments:{levels:{fortune:3}}}
150
+
```
151
+
152
+
Now you've got a valid value for the `tag` key.
153
+
154
+
### Upgrading items with tag
155
+
156
+
Because tags are version-specific, upgrading the server may break older tags. Since Screaming BedWars 0.2.27, you can add a `DataVersion` field to let the game upgrade the tag:
157
+
158
+
```yaml
159
+
- stack:
160
+
type: diamond_pickaxe
161
+
DataVersion: 1343
162
+
tag: '{Enchantments:[{lvl:3,id:fortune}]}'
163
+
```
164
+
165
+
Here, `1343` is the data version for Minecraft `1.12.2`. The tag will be upgraded when having server on newer versions everytime the server is loaded. The file itself remains unchanged.
166
+
167
+
You can find Minecraft data versions on [this wiki page](https://minecraft.wiki/w/Data_version).
168
+
169
+
## Item Positioning
170
+
171
+
By default, items are rendered in order from left to right, top to bottom. However, SimpleInventories (and therefore Screaming BedWars) allows you to control the layout using positioning directives. These can help with alignment, spacing, and organizing items into rows, columns, or even multiple pages.
172
+
173
+
### `skip`
174
+
175
+
Skips a number of slots before placing the next item.
176
+
177
+
```yaml
178
+
- stack: chest for 1 bronze
179
+
skip: 3
180
+
```
181
+
182
+

183
+
184
+
### `column` and `row`
185
+
186
+
Use these to place an item in a specific column or row. `column` starts from `0`, while `row` starts from `1`.
187
+
For `column`, you can also use special values: `left`, `center`, and `right` instead of a number.
188
+
189
+
```yaml
190
+
- stack: iron_block for 10 gold
191
+
column: 1
192
+
- stack: glowstone for 5 iron
193
+
row: 4
194
+
column: center
195
+
```
196
+
197
+

198
+
199
+

200
+
201
+
### `linebreak`
202
+
203
+
Forces the next item to be placed on a new row. Think of it as pressing "Enter" after an item.
204
+
205
+
There are three valid values for `linebreak`:
206
+
* `before` - Breaks the line before the item is rendered
207
+
* `after` - Breaks the line after the item is rendered
208
+
* `both` - Applies both `before` and `after`
209
+
210
+
```yaml
211
+
- stack: ender_chest for 5 iron
212
+
linebreak: before
213
+
```
214
+
215
+

216
+
217
+
### `pagebreak`
218
+
219
+
Forces the next item to be placed on a new page.
220
+
221
+
Like `linebreak`, `pagebreak` accepts three values:
222
+
* `before` - Breaks the page before the item is rendered
223
+
* `after` - Breaks the page after the item is rendered
224
+
* `both` - Applies both `before` and `after`
225
+
226
+
```yaml
227
+
- stack: gunpowder for 5 iron
228
+
pagebreak: before
229
+
row: 3
230
+
```
231
+
232
+

233
+
234
+
### absolute (not recommended)
235
+
236
+
Places an item at an exact slot index (starting from `0`). This bypasses all automatic positioning logic and should only be used if you need full manual control.
237
+
238
+
```yaml
239
+
- stack: obsidian for 20 gold
240
+
absolute: 13
241
+
```
242
+
243
+
This can make layouts harder to maintain and **is not recommended** unless absolutely necessary.
0 commit comments