Currency Pouches
On this page(12)
A pouch is an item that gives a random whole amount of one currency when a player right clicks it. A title then reveals the amount digit by digit, like a slot machine. Pouches make good rewards for crates, shops, milestones and votes, because the surprise feels better than a fixed amount.
| Files | the pouches: block of each currencies/<id>.yml, the pouches: block of config.yml |
| Player action | Right click a pouch (shift + right click opens every pouch of that currency) |
| Admin commands | /dungeons admin pouch give <player> <currency>:<pouch> [amount] |
| Reward tag | [give-pouch] <currency>:<pouch> [amount] |
| Switch | Always on (core). A currency without a pouches: block has no pouches |
How it works
- The item. Each pouch of a currency file is an item. The pouch
t1ofmoneyis the SnLib itempouch-money-t1. It stacks up to 64. - Opening one. A right click with a pouch in the main hand opens ONE pouch.
- Opening all. Shift + right click opens every pouch of THAT currency in the inventory, any tier. It takes the held stack first, then the inventory, then the off hand (never armor).
- The roll. Each pouch rolls its own amount between
minandmax. Every whole value is as likely. - The money. One open is ONE give of the total, at once. It stops at the currency's
max-value, like any give. - The show. A chat line comes at once. Then the title reveals the amount. The title is only visual: the money is already given.
Good to know:
- A right click on a block you can use (a chest, a door) uses the block, unless you sneak.
- A pouch in the off hand never opens by its own click.
- A pouch is never boosted. It is not a gain, so the Grind Summary does not count it.
- A BUNDLE pouch never holds items: its bundle contents are removed.
- The Luck effect
double-pouchcan double the amount of an open.
Configuration
pouches (in a currency file)
One block per pouch, under the root key pouches: of currencies/<id>.yml. The block is marked # sn:extensible: it is yours.
| Key | Default | What it does |
|---|---|---|
<id> | The pouch id: lowercase letters, digits and -, at most 32. | |
<id>.min | required | The smallest amount. Written like the rest of the file (1.5K, '1e500'). A fraction is rounded. |
<id>.max | required | The largest amount. min must not be above max. |
<id>.item.material | BUNDLE | The item material. An unknown one is BUNDLE (one warning). |
<id>.item.name | the id | The item name. Color codes allowed. |
<id>.item.lore | none | The item lore lines. |
<id>.item.glow | false | true adds the enchantment glint. |
<id>.item.custom-model-data | 0 | The custom model data. 0 means none. |
In name and lore, {min} and {max} (in the currency format) and {currency} (its name) are replaced.
currencies/money.yml
pouches:
t1:
min: 100
max: 10000
item:
material: BUNDLE
name: '&aMoney Pouch &7(Tier 1)'
lore:
- '&7Contains between &a{min} &7and &a{max}'
- ''
- '&8Right click to open'
- '&8Shift + right click to open all'
glow: true
custom-model-data: 0The shipped pouches:
| Currency | Pouch | Amount |
|---|---|---|
money | t1 | 100 to 10,000 |
money | t2 | 10,000 to 1,000,000 |
souls | t1 | 10 to 1,000 |
perk-tickets | t1 | 1 to 5 |
Mistakes. A bad id, a missing or unreadable min or max, or a min above max skips the pouch. A broken part of item reads its default. Each is one console warning naming the file and the key.
min and max are read when a pouch is opened. A change reaches the pouches already given, but their lore keeps the old text. Old and new pouches then no longer stack.
pouches (config.yml)
The pouches: block of config.yml sets how every pouch opens and reveals.
| Key | Default | What it does |
|---|---|---|
bulk-limit | 0 | The most pouches one shift + right click opens. 0 means no limit. The limit can cut a stack. |
cooldown-ticks | 5 | Ticks a player waits between two opens (0 to 200). 0 means none. |
pouches.animation
The title that reveals the amount.
| Key | Default | What it does |
|---|---|---|
display | full | full writes every digit with a separator (4,300). formatted uses the currency number format (4.3K). |
separator | ',' | The thousands separator of full. '' means none. |
hidden-format | '&7&k' | The codes of a hidden digit. Start with a color code: a color code clears &k and &l. |
revealed-format | '&a&l' | The codes of a revealed digit. |
start-delay | 10 | Ticks with every digit hidden before the first one shows (0 to 200). |
ticks-per-step | 4 | Ticks between two digits (1 to 40). |
step-sound | BLOCK_NOTE_BLOCK_HAT | The sound of each digit. '' means none. |
step-volume | 1.0 | Its volume (0 to 10). |
pitch-from | 0.8 | The pitch at the first digit (0.5 to 2.0). |
pitch-to | 2.0 | The pitch at the last digit. The pitch rises in between. |
subtitle | '&7{count}x {pouch}' | The subtitle while the digits show. {currency}, {count} (pouches opened), {pouch} (the item name). |
final-title | '&a&l+{amount}' | The title at the end. {amount} is the revealed text. |
final-subtitle | '{currency}' | The subtitle at the end. |
final-sound | ENTITY_PLAYER_LEVELUP | The sound at the end. '' means none. |
final-particle | '' | A particle at the end, shown to the opener only. A particle that needs extra data is refused. |
final-particle-count | 30 | How many particles (1 to 500). |
stay | 40 | Ticks the final title stays (0 to 200). |
fade-out | 10 | Ticks the final title fades out (0 to 100). |
A value outside its range reads its default, with one console warning. full writes an amount of 10^15 or more in the currency format.
Timing example. A pouch of 4,300 has four digits. With the defaults, the first digit shows at tick 10, then one every 4 ticks. The final title lands at tick 26 (1.3 seconds).
What the player sees
The chat line messages.pouches.opened of lang/messages_en.yml comes at once, for example You opened 3x Money Pouch (Tier 1): +12.5K Money. Several pouch kinds opened together show the word status.pouches-mixed as {pouch}.
A new open replaces a running reveal (its final title never shows).
Players control the show in /settings:
| Setting | Off means |
|---|---|
Titles (core.titles) | No title at all. The final sound and particle still play. |
Pouch Animation (core.pouch-animation) | No digit by digit reveal: only the final title, at once. |
Sounds (core.sounds) | No step or final sound. |
Particles (core.particles) | No final particle. |
The money and the chat line always come.
Giving pouches
| Way | Syntax | Notes |
|---|---|---|
| Admin command | /dungeons admin pouch give <player> <currency>:<pouch> [amount] | An online player, 1 to 2304 (1 by default). Stacks of 64; what does not fit drops at their feet. |
| Reward tag | [give-pouch] <currency>:<pouch> [amount] | Any reward line: a shop entry, a milestone, a crate. The same limits. |
A broken [give-pouch] line gives nothing and sends nothing, with one console warning per line. Nothing is logged until the pouch is opened. The open then logs a GIVE row with the cause pouch:<id> (or pouch:multi for several kinds).
A shop entry that sells pouches
actions:
- "[give-pouch] money:t1 5"Removing a pouch
A pouch you remove from the file (or whose currency you remove) answers messages.pouches.unknown when clicked. It stays in the inventory. Its item definition stays until a restart.
Currency files are never updated. To add pouches to an older install, copy the pouches: block of currencies/money.yml from the jar (it is a zip). Paste it into your file and run /dungeons reload.
Commands
| Command | Permission | Description |
|---|---|---|
/dungeons admin pouch give <player> <currency>:<pouch> [amount] | sndungeons.admin.pouch.give | Gives an online player currency pouches (what does not fit drops at their feet). |
Full list: Commands and Permissions.
Placeholders
The same values for every player. Full list: Placeholders.
| Placeholder | Description |
|---|---|
%sndungeons_pouch_<currency>_<pouch>_min%, _max | The smallest and largest amount of the pouch, formatted |
%sndungeons_pouch_<currency>_<pouch>_min_raw%, _max_raw | The same amounts as plain numbers |
%sndungeons_pouch_<currency>_<pouch>_name% | The pouch item's name |
Tips
- Use a wide range (100 to 10,000) for excitement, a narrow one for a predictable reward.
- Give each tier a different
custom-model-dataso a resource pack can draw it. - Set
bulk-limitif a player opening thousands of pouches at once floods your log. - Test the reveal with
/dungeons admin pouch give <you> money:t2 3, then shift + right click.
Default pouches: block of config.yml
# ------------------------------------------------------------
# Currency pouches: the pouches of each currency are defined in its file
# (pouches: of currencies/<id>.yml). Right click opens the pouch in hand;
# shift + right click opens every pouch of that currency in the inventory.
# The money is given at once; the title below only shows it. The players
# turn the titles and the reveal off in /settings (Titles, Pouch
# Animation). Re-read on /dungeons reload.
# ------------------------------------------------------------
pouches:
# The most pouches one shift + right click opens; 0 = no limit.
bulk-limit: 0
# Ticks a player waits between two opens (0 to 200); 0 = none.
cooldown-ticks: 5
# The title that reveals the amount, digit by digit.
animation:
# full = every digit with separator (4,300); formatted = the currency
# number format of currencies.number-format (4.3K).
display: full
# The thousands separator of full; '' = none.
separator: ','
# The codes of a hidden digit and of a revealed one. Start each with a
# color code: a color code clears &k and &l.
hidden-format: '&7&k'
revealed-format: '&a&l'
# Ticks with every digit hidden before the first one shows (0 to 200).
start-delay: 10
# Ticks between two digits (1 to 40).
ticks-per-step: 4
# The sound of each digit ('' = none), its volume (0 to 10) and its
# pitch, rising from pitch-from at the first digit to pitch-to at the
# last (0.5 to 2.0).
step-sound: BLOCK_NOTE_BLOCK_HAT
step-volume: 1.0
pitch-from: 0.8
pitch-to: 2.0
# The subtitle while the digits show: {currency} (its name), {count}
# (pouches opened) and {pouch} (the pouch item name, or a word when several
# kinds were opened).
subtitle: '&7{count}x {pouch}'
# The title and subtitle at the end; {amount} too (the revealed text).
final-title: '&a&l+{amount}'
final-subtitle: '{currency}'
# The sound at the end ('' = none).
final-sound: ENTITY_PLAYER_LEVELUP
# A particle at the end, shown to the player only ('' = none), and how
# many (1 to 500). A particle that needs extra data is not supported.
final-particle: ''
final-particle-count: 30
# Ticks the final title stays (0 to 200) and fades out (0 to 100).
stay: 40
fade-out: 10