-
Notifications
You must be signed in to change notification settings - Fork 11
/
offers-vanilla.yml
572 lines (517 loc) · 27.4 KB
/
offers-vanilla.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# This file, 'offers-vanilla.yml', provides a configuration which would create vanilla Minecraft trade offers if copied
# into your 'offers.yml'. Do not edit this file, as it is never loaded by the plugin, and is merely for your reference.
# Obviously, you may paste it into 'offers.yml' and edit its contents there - this can be handy if you wanted vanilla
# trading to be your starting point. If you forget and accidentally edit this file, simply delete or rename it: the
# plugin will automatically recreate this file.
# Everything past this line is what would be found in an 'offers.yml' configured to vanilla Minecraft settings.
# ************************************** An explanation on offer config files ************************************** #
# 'offers.yml' is the file used by Rebalance Villagers to determine the offers generated by villagers.
# 'offers-default.yml' is an exact copy of 'offers.yml', and should not be edited, because it is not used by the
# plugin. It is a reference for your convenience - if you accidentally edit 'offers-default.yml', simply delete it and
# it will be recreated upon server reload or restart.
# 'offers-vanilla.yml' is another reference file. Like 'offers-default.yml', it should not be edited, as its values
# aren't used by the plugin. The values in this file can be copied into 'offers.yml' to have vanilla Minecraft offer
# generation, or can be used as a starting point for more vanilla-like values.
# Oh yeah, and because 'offers-default.yml' is an exact copy of 'offers.yml', please make sure you are in 'offers.yml'
# before making any changes ;)
# *************************************** An explanation on "Smart Stacking" *************************************** #
# Before explaining the properties in this file, I'll describe the "Smart Stacking" feature I've implemented. For
# most offers defined in this file, if a villager wants more than 64 of an item, the request is split into both
# buy slots: for example, instead of requesting 96 paper in one input slot (which would be an impossible offer for the
# player to complete), the villager will request 64 paper in one slot and 32 in the other (a total of 96, the intended
# amount).
# Note that this simple split cannot handle offers for more than 128 of an offer: an offer requesting 129 paper, for
# example, will still be impossible to complete, as it will be a request for 64 and 65 paper. Also, Smart Stacking will
# not actually check that the item stacks up to 64 - if you need, say, an offer to buy 30-32 enderpearls, you will need
# to define a custom offer where the first slot is 16 and the second is 14-16.
# Fortunately, Smart Stacking also accounts for certain 'compressed' forms of items. For example, an offer requesting
# 496 emeralds would be represented as a request for 55 emerald blocks and 3 emeralds: as emeralds can be freely
# crafted into blocks and vice versa, an emerald block is literally equivalent to 9 emeralds.
# This "Smart Compression" feature applies anywhere Smart Stacking applies, and compresses the following items:
# - Emeralds into Emerald Blocks
# - Diamonds into Diamond Blocks
# - Gold Ingots into Gold Blocks
# - Gold Nuggets into Gold Ingots
# - Iron Ingots into Iron Blocks
# Smart Compression will not introduce rounding error, so a villager can request a maximum of 640 of a compressible
# item - one stack of its compressed form, and one stack of its normal form.
# Be careful: if a stack of items is too large, it will become 'negative' for the client, at which point a large number
# of very abusable glitches become possible. At even larger values, the stack will appear positive again, so for
# example a stack of 318 would appear as 63, and your players will be confused as to why a villager isn't accepting the
# offer.
# To prevent these issues, simply make sure you don't have any numbers which are too large in this file. I will let you
# know what the maximum safe amount is for any relevant part of the following configuration file.
# ************************************ The actual configuration for you to edit ************************************ #
# This is the item villagers will treat as currency. Any references to "currency-item" in your offers below are
# conveniently interpreted as this item, too. You may specify a numeric ID *in apostrophes*, for example '4' would
# represent cobblestone. The default value is "emerald".
currency-item:
emerald
# This is the list of offers which may generate for each villager profession. You may specify a profession by name, or
# by the profession ID. IDs 5 and above are unused villagers, which all wear green robes. You can basically add as many
# custom professions as you like by using IDs, but they will not spawn until those IDs are also listed in
# 'general.allowed-spawn-professions' of config.yml. World editors can also spawn custom villagers, of course. If you
# wish to list a profession by ID, the number must be enclosed in apostrophes, like '5'.
potential-offers:
# This is a sample villager profession: the unused green villager. By default this villager will never spawn, so I
# am using its offer list as an example to teach you how this config works. Actual offers used by existing
# villagers can be found after this. If you're good at guessing, you may be able to skip this "tutorial"
# altogether - otherwise, think of it as a reference in case you're uncertain.
# Oh, and if you wanted to give actual offers to the 5th villager, but don't want to delete all this informative
# text, simply change that '5' to '20' or some other profession ID you're not worried about (anything above 4 is
# unused by default).
'5':
# First, every profession is followed by an indented list representing the offers which can generate. There are
# three sections which must exist: 'buys', 'sells', and 'other'.
# "buys": These are items a villager will buy from a player. The format is:
# item-name: offer-probability
#
# You can specify an item ID or block ID for item-name if you wish, but it must be enclosed in apostrophes.
#
# The value for offer-probability must be a decimal number between 0.0 and 1.0, inclusive. If it is 0.0, the
# offer will simply never be generated. If it is 1.0, it will be extremely likely to be generated, and also
# prevents the villager from generating "default" offers (explained later in this file).
#
# You only specify the item to be bought here - the amount to buy (or buy it for) is specified later in this
# file, in 'buy-values'. These items are bought by the villager, in exchange for the currency-item.
# If an item is not specified in 'buy-values', its value will default to 1 of the currency-item.
buys:
bedrock: 0.5
record: 0.3
'329': 0.5
# Note that this villager will accept any record, as they do not distinguish between damage values - this is a
# vanilla mechanic which I cannot safely change.
# Also, '329' is the ID of a saddle. "saddle" (without quotes) would have worked equally well, but I just
# wanted to demonstrate :p
# "sells": These are items a villager will sell to a player. The format is:
# item-name: offer-probability
#
# You only specify the item to be sold here (and the chance of the offer) - the amount to sell (or sell it for)
# is specified later in this file, in 'sell-values'. These items are sold by the villager, in exchange for the
# currency-item.
# If an item is not specified in 'sell-values', its value will default to 1 of the currency-item.
#
# This list is formatted exactly the same as 'buys', so instead of demonstrating sell offers, I'll take the
# opportunity to show you how you should properly indicate a villager has no offers in a list:
sells:
nothing
# "other": These are special or custom offers. They allow you to specify the exact contents of all three offer
# slots (the two inputs and one output), and thus allow you to create offers the 'buys' and 'sells' list cannot
# create. Each element in this list is a custom offer, which can have any name you desire.
#
# Note that each custom offer must have a different name, and if you use numbers as names, those numbers must
# be in apostrophes!
other:
# This is a custom offer. Yes, that was descriptive.
custom-offer:
# All custom offers must have a 'buyA' property. This is the first input slot of the trade.
buyA:
# The following are all the properties an offer slot can have.
# These will also work in 'buyB' and 'sell'.
# The only mandatory property is the item itself. Again, this can be an ID in apostrophes.
item: swordIron
# The damage-value of an item. This is optional and defaults to 0. Some items use damage-values for
# alternate forms of the item, such as different dyes. In this case, we are specifying a request
# for a half-used iron sword. Note that villagers ignore the damage value when buying an item - a
# villager will just as easily accept an almost-depleted iron sword or an unused iron sword here!
damage: 125
# The amount of an item in this stack. Smart Stacking and Smart Compression do NOT apply for custom
# offers, so unless you want some rather unfriendly glitches, never put more than 64 here! Also
# never put less than 1, for the same reasons.
# This property is optional and defaults to 1 if it is missing.
# This number must be in [] brackets, because it is actually a range. I'll mention more about that
# below.
amount: [1]
# The level range to enchant the item at. This does a standard enchantment on the item, with
# properties identical to an enchantment performed by a player spending the given amount of
# levels.
# If this property is missing, the item is not enchanted. There is no point in attempting to
# enchant unenchantable items using this. In addition, like damage values, villagers will not
# recognize enchantments when buying an item - thus this villager would just as easily accept an
# unenchanted sword!
# Again, this property is in [] brackets because it is a range. This means that a random number is
# picked, ranging anywhere between the first and second number - in this case, the enchantment will
# be anywhere between 15 and 30 levels, inclusive. If you only specify one value in a range, it
# will not be random, instead using that fixed value (which is why "amount: [1]" above specifies we
# are only requiring one of the item).
enchant-level: [15,30]
# The buyB property is optional, and represents the second input slot of a trade. Its format is exactly
# the same as buyA.
buyB:
# Rather than specifying an item name or ID, you can set the name to "currency-item" to use the
# currency item you specified at the start of this configuration.
item: currency-item
# Here we see a random range specified for the item amount: anywhere between 34 and 64 of the
# currency item will be requested. As a reminder, you should never set amount higher than 64 for
# custom offers such as this.
amount: [34,64]
# All custom offers must also have a 'sell' property. As its name suggests, it represents the output
# slot of a trade. Its format is the same as buyA and buyB, but damage values and enchantments actually
# matter here, as the item displayed above the output slot is exactly the item the player will get!
sell:
# '1' is the ID of stone. Of course, a simple "stone" would have sufficed, but I felt like
# demonstrating ID use as this offer is nonsensical already.
item: '1'
amount: [5, 6]
# The probability value of this offer. This functions in exactly the same way as the probability of
# non-custom offers. Note that if you forget this property, the offer will simply never be generated,
# as it will be processed with a probability of zero.
probability: 0.5
# This is another custom offer. Yes, the tutorial's not done yet!
# First, notice how I was too lazy to think of a name, so I simply called my offer "'1'". The apostrophes,
# as you've probably learned by now, are mandatory if you're just using numbers.
'1':
buyA:
# The names my plugin identifies are the in-code names Minecraft uses for items - in this case,
# dyePowder is actually the item for ink sacs, bonemeal, lapis, and other dyes. When in doubt, just
# use an ID instead :p
item: dyePowder
# A damage value of 4 on dyePowder is Lapis Lazuli. But remember: villagers can't differentiate
# between damage values, so while the offer slot will display lapis, the villager will just as
# easily accept ink sacs, bonemeal, or any other dyes!
damage: 4
amount: [9,15]
sell:
# Oh, guess what? My plugin can also make use of Bukkit's ItemStack loading feature. If you know
# how to write ItemStacks in yml, or have a plugin that can output them, you can specify the exact
# enchantments you want your item to have. I'm not explaining how ItemStacks are written, as I'm
# not so certain myself, but you can guess by looking at the following, and even copy it as a
# basis. Sadly, Bukkit provides no mechanism for loading a book's text from yml, so this feature is
# really only useful for getting specific enchants.
# Note: if you wish to use an itemstack, you must only include the 'itemstack' property. Other
# properties are ignored, or the itemstack itself will be ignored if 'item' exists.
itemstack:
==: org.bukkit.inventory.ItemStack
type: IRON_PICKAXE
damage: 200
amount: 23
enchantments:
DIG_SPEED: 4
DURABILITY: 3
SILK_TOUCH: 1
probability: 0.1
# That's the end of the "tutorial". The following are actual offers used by the plugin.
farmer:
buys:
wheat: 0.9
# (cloth is wool)
cloth: 0.5
chickenRaw: 0.5
fishCooked: 0.4
sells:
bread: 0.9
# ('360' is melon slice. "melon" would be ambiguous as it references both the item and the block)
'360': 0.3
apple: 0.3
cookie: 0.3
shears: 0.3
flintAndSteel: 0.3
chickenCooked: 0.3
arrow: 0.5
other:
gravel-conversion:
buyA:
item: gravel
amount: [10]
buyB:
item: currency-item
amount: [1]
sell:
item: flint
amount: [4, 5]
probability: 0.5
librarian:
buys:
paper: 0.8
book: 0.8
writtenBook: 0.3
sells:
bookshelf: 0.8
glass: 0.2
compass: 0.2
clock: 0.2
other:
nothing
priest:
buys:
nothing
sells:
eyeOfEnder: 0.3
expBottle: 0.2
redstone: 0.4
lightgem: 0.3
other:
enchant1:
buyA:
item: swordIron
buyB:
item: currency-item
amount: [2, 4]
sell:
item: swordIron
enchant-level: [5, 19]
probability: 0.1
enchant2:
buyA:
item: swordDiamond
buyB:
item: currency-item
amount: [2, 4]
sell:
item: swordDiamond
enchant-level: [5, 19]
probability: 0.1
enchant3:
buyA:
item: chestplateIron
buyB:
item: currency-item
amount: [2, 4]
sell:
item: chestplateIron
enchant-level: [5, 19]
probability: 0.1
enchant4:
buyA:
item: chestplateDiamond
buyB:
item: currency-item
amount: [2, 4]
sell:
item: chestplateDiamond
enchant-level: [5, 19]
probability: 0.1
enchant5:
buyA:
item: hatchetIron
buyB:
item: currency-item
amount: [2, 4]
sell:
item: hatchetIron
enchant-level: [5, 19]
probability: 0.1
enchant6:
buyA:
item: hatchetDiamond
buyB:
item: currency-item
amount: [2, 4]
sell:
item: hatchetDiamond
enchant-level: [5, 19]
probability: 0.1
enchant7:
buyA:
item: pickaxeIron
buyB:
item: currency-item
amount: [2, 4]
sell:
item: pickaxeIron
enchant-level: [5, 19]
probability: 0.1
enchant8:
buyA:
item: pickaxeDiamond
buyB:
item: currency-item
amount: [2, 4]
sell:
item: pickaxeDiamond
enchant-level: [5, 19]
probability: 0.1
blacksmith:
buys:
coal: 0.7
ingotIron: 0.5
ingotGold: 0.5
diamond: 0.5
sells:
swordIron: 0.5
swordDiamond: 0.5
hatchetIron: 0.3
hatchetDiamond: 0.3
pickaxeIron: 0.5
pickaxeDiamond: 0.5
shovelIron: 0.2
shovelDiamond: 0.2
hoeIron: 0.2
hoeDiamond: 0.2
bootsIron: 0.2
bootsDiamond: 0.2
helmetIron: 0.2
helmetDiamond: 0.2
chestplateIron: 0.2
chestplateDiamond: 0.2
leggingsIron: 0.2
leggingsDiamond: 0.2
bootsChain: 0.1
helmetChain: 0.1
chestplateChain: 0.1
leggingsChain: 0.1
other:
nothing
butcher:
buys:
coal: 0.7
porkchopRaw: 0.5
beefRaw: 0.5
sells:
saddle: 0.1
# ("cloth" items are actually leather)
chestplateCloth: 0.3
bootsCloth: 0.3
helmetCloth: 0.3
leggingsCloth: 0.3
porkchopCooked: 0.3
beefCooked: 0.3
other:
nothing
# These are the offers which are generated by default. This means that technically any villager profession can make
# these offers, but in practice, they rarely do. When exactly is a default offer generated?
# Well, first, the probability value of an offer determines how likely it is to end up in a "hat" of offers, and,
# based on your 'default-offer-count' and 'new-offer-count' values, a certain number (1 by default) of offers are
# taken from that "hat" and added to the villager. However, if the hat is empty, default offers will be generated
# instead.
# The hat is rarely empty, and is more likely to be empty if a villager has few offers - it is never empty if the
# villager has at least one offer with a probability of 1.0, so such villagers cannot generate default offers.
#
# You can actually have any number of default offers, if you like, but it is recommended that at least one has
# a probability of 1.0. Otherwise, the hat might be empty even after passing over this list of default offers. In
# case that happens, there is a hard-coded default offer to buy gold ingots - but you never have to worry about
# it if you have at least one offer here with a probability of 1.0.
default-offers:
buys:
ingotGold : 1.0
sells:
nothing
other:
nothing
# These values define the prices villagers will buy items for. These apply to all offers in any 'buys' list.
# The format is:
# item-name: [minimum, maximum]
# Alternatively, the following is acceptable:
# item-name: [minimum]
#
# You can specify an item ID or block ID for item-name if you wish, but it must be enclosed in apostrophes.
#
# If you don't specify maximum, it is treated as equal to the minimum.
#
# The purpose of minimum and maximum can be a little tricky: a random number between minimum and maximum (inclusive) is
# picked. If the resulting number is positive, then the villager will request this many of the item in exchange for 1
# of the currency-item.
# If the number is negative instead, the villager will request 1 of the item in exchange for a number of currency-item
# equal to the negation of the negative number.
# If the number is zero, the villager will request 1 of the item in exchange for 1 of the currency-item.
#
# To clarify: [1, 40] means a villager will ask for anywhere between 1 and 40 (inclusive) of the item, for 1
# currency-item.
# [-25, -20] means a villager will ask for 1 of the item, in exchange for anywhere between 20 and 25 (inclusive) of the
# currency-item.
# [-2, 2] is interesting: the villager may ask for 2 of the item in exchange for 1 currency-item, 1 of the item in
# exchange for 1 currency-item, or 1 of the item in exchange for 2 of the currency-item.
#
#
# Smart Stacking and Smart Compression apply for values listed here. Because of this, you can safely have any number go
# as high as 128. In addition, if an item is compressible (emerald, diamond, gold ingot, gold nugget, or iron ingot),
# you can have it go as high as 640. However, Smart Stacking/Compression only apply to the input slots: never have any
# number here go below -64.
#
# Thus, the largest safe range is [-64, 128] for any* item, and [-64, 640] for compressible items.
# If a number is outside this range, it is possible for a buggy offer to be created, which opens the doorway to
# uncompletable offers and item duping - so be careful and make sure that your numbers are within the range!
# *Note: if an item is non-stackable or stacks to a number less than 64, Smart Stacking will not handle it properly:
# you can consider using a custom offer to handle this yourself instead.
#
# Oh, and finally, make sure the minimum is actually less than the maximum. [-20, -40] is incorrect because -20 is
# greater than -40!
buy-values:
coal: [16, 23]
ingotIron: [8, 9]
ingotGold: [8, 9]
diamond: [4, 5]
fishCooked: [9, 12]
chickenRaw: [14, 17]
porkchopRaw: [14, 17]
beefRaw: [14, 17]
cloth: [14, 21]
wheat: [18, 21]
paper: [19, 35]
book: [12, 14]
writtenBook: [1]
# The following are unused:
enderPearl: [3]
eyeOfEnder: [2]
seeds: [34, 47]
seeds_melon: [30, 37]
seeds_pumpkin: [30, 37]
rottenFlesh: [36, 63]
# These values define the prices villagers will sell items for. These apply to all offers in any 'sells' list.
# The format is identical to the format of buy-values.
#
# The random number now applies to the number of currency-item an offer costs if positive, and the number of item the
# villager sells if negative.
#
# To clarify: [1, 40] means a villager will ask for anywhere between 1 and 40 (inclusive) of the currency-item, for 1
# of the item.
# [-25, -20] means a villager will ask for 1 of currency-item, in exchange for anywhere between 20 and 25 (inclusive)
# of the item.
# [-2, 2] means the villager may ask for 2 of currency-item in exchange for 1 of the item, 1 currency-item in
# exchange for 1 of the item, or 1 of currency-item in exchange for 2 of the item.
#
# Smart Stacking and Smart Compression apply for values listed here. The largest safe range is [-64, 128] for any*
# currency-item, and is [-64, 640] if your currency-item is compressible. If a number is outside this range, it is
# possible for a buggy offer to be created, which opens the doorway to uncompletable offers and item duping - so be
# careful and make sure that your numbers are within the range!
# *Note: if an item is non-stackable or stacks to a number less than 64, Smart Stacking will not handle it properly.
# Also, such an item is a horrible choice for your currency-item :p
#
# Oh, and once again, make sure the minimum is actually less than the maximum. [-20, -40] is incorrect because -20 is
# greater than -40!
sell-values:
redstone: [-4, -2]
lightgem: [-3, -2]
glass: [-5, -4]
chickenCooked: [-8, -7]
porkchopCooked: [-7, -6]
beefCooked: [-7, -6]
saddle: [6, 7]
'360': [-8, -5]
apple: [-8, -5]
bread: [-4, -3]
cookie: [-8, -10]
bookshelf: [3]
eyeOfEnder: [7, 10]
shears: [1]
flintAndSteel: [1]
arrow: [-5, -19] # Yes, this is incorrect, but that's how it is in vanilla!
compass: [10, 11]
clock: [10, 11]
swordIron: [7, 10]
hatchetIron: [6, 7]
pickaxeIron: [7, 8]
shovelIron: [4, 5]
hoeIron: [4, 5]
swordDiamond: [12, 13]
hatchetDiamond: [9, 11]
pickaxeDiamond: [10, 11]
shovelDiamond: [7]
hoeDiamond: [7]
helmetCloth: [2, 3]
chestplateCloth: [4]
leggingsCloth: [2, 3]
bootsCloth: [2, 3]
helmetIron: [4, 5]
chestplateIron: [10, 13]
leggingsIron: [8, 9]
bootsIron: [4, 5]
helmetDiamond: [7]
chestplateDiamond: [16, 18]
leggingsDiamond: [11, 13]
bootsDiamond: [7]
expBottle: [-4, -2]
helmetChain: [5, 6]
chestplateChain: [11, 14]
leggingsChain: [9, 10]
bootsChain: [5, 6]