Page 1 of 1

Configurable Vending Machines

PostPosted: 05 Mar 2023 00:09
by reiyooki
It would be wonderful to have the ability to configure the vending machine items and prices. This would allow servers to do some really neat things with them, rather than relegating them to a seldom-used decoration block.

Configurable Vending Machines

PostPosted: 05 Mar 2023 13:26
by SKyTheThunder
I believe there are plans to tie Vending Machines to their own shopkeeper file like the NPCs.
Might be possible to give the block an NBT tag that allows pointing it to a different shop file too.

Re: Configurable Vending Machines

PostPosted: 16 Apr 2023 17:19
by 9Tales
I definitely think we should add the ability to edit the default list of items sold in vending machines with datapacks.

There are also ways to expand on this:
  1. Having a way to spawn in a vending machine that draws from a different pool than the default. Every crafted vending machine used by normal players would draw from the default pool, but it would be possible with commands or something to make a vending machine draw its items from a different pool. For example, it would be possible to add a Pixelmon TCG pack vending machine in a world where most vending machines are drink vending machines. Perhaps this could be done with commands, or all available pools could be cycled through with debug stick.
  2. Making it possible to configure the different colors of vending machines to have different pools if we want. For example, with datapacks you may be able to make all red vending machines sell Poke Balls, all blue vending machines sell drinks, all yellow vending machines sell healing items, and so on.

Configurable Vending Machines

PostPosted: 17 Apr 2023 04:22
by SKyTheThunder
Imo the most consistent would be to do it via an NBT tag, like Vanilla does for chest loot.

Similar to applying a loot table to a container:
minecraft:chest{LootTable:"<namespace>:<path/to/loot_table>"}
you could apply a shopkeeper file to a Vending Machine:
pixelmon:<color>_vending_machine{ShopFile:"<namespace>:<path/to/shopkeeper>"}

(The shop file root folder the tag checks relative to should be data/<namespace>/npcs/shopkeepers/, staying consistent with other applications of namespaced paths. Loot tables for example use data/<namespace>/loot_tables/ as their root.)

Re: Configurable Vending Machines

PostPosted: 08 Jun 2023 23:48
by Mike5357
Really desperate for this one :oops: