Adding Commands to Your Store
Fri Jul 16 2021
When you set up a store for your Minecraft server and add blocks, weapons, tools or cosmetics for your players to buy - which you can find for free online, or create yourself - the last part of the process is to set the command for each item that will actually put it in the game.
Commands tell your server to place a particular item in a player’s inventory so they can use it in the game. Commands use a simple structure that tells your server what item to give, to which player, and how many of those you’re giving them.
When you’re starting out, adding standard Minecraft items to your server store is a good place to begin. Diamond blocks and tools for example, are things that most players will need more of from time to time.
Adding a product to your store is easy if you follow the instructions in the PlayerLands portal, and when it comes to adding the right command, Minecraft Gamepedia is your friend.
Just search for the item you’re selling, for example a Golden Axe. Scroll down its page in Gamepedia until you get to the section on Data Values. Those are the instructions that identify each item in the game. Find Java Edition, and then look for the Golden Axe, which has the data value golden_axe.
You make that into a command for your store using the format:
Give [player] Minecraft:<Data_Value>
So to create the command for a player to purchase a Golden Axe, you’d set up the product in your store and add the command:
Give [player] Minecraft:golden_axe 1
And that’s all there is to it. As you extend your store and get more players on your server, you can start adding new products and inventing your own, but until that happens there are plenty of items you can use that already exist in the game itself, and once you know how, creating commands to make them work is very straightforward.