Is there a way I can store variables in my Minecraft world?

Is there a way I can store variables in my Minecraft world? - Side view of faceless woman in casual clothing and Asian conical hat pushing cart while walking on paved pedestrian road between store and trees

I’m trying to make bank accounts for players in a Minecraft world. Is there a feature in Minecraft commands that would enable me to do this using variables? If so, which commands would allow me to utilise this, or if not, what would be my best option?



Best Answer

Have a bank user use a "Key" that is specific to their account to access their selected currency. The key can be any item that is named. An example of this would be an apple that is named "Open". The key will have to be placed in a chest or hopper which will lead to redstone circuitry that will "unlock" the said bank account. The user will then put their goods in a chest that will put their goods away into their account before a lever is pulled and the key is dropped out again for the user.




Pictures about "Is there a way I can store variables in my Minecraft world?"

Is there a way I can store variables in my Minecraft world? - Side view of modern female walking on sidewalk near red building on city street
Is there a way I can store variables in my Minecraft world? - Truck riding on rural road in countryside
Is there a way I can store variables in my Minecraft world? - Store with creative cow pattern and signboard located on asphalt sidewalk on street with buildings and leafless trees in town



How do you use the data storage command in Minecraft?

You can use the /data command to get, merge and remove NBT tags (formerly called data tags) for entities and block entities. The /data command is most useful for changing attributes of a mob after the mob has spawned or modifying attributes of a block entity after you have placed it.

Can you use variables in Minecraft commands?

Minecraft commands do have a form of variables, but, unfortunately, they can only store numeric values. This is called the scoreboard, and you can add and access variables by using the /scoreboard command.

How do you autofill in Minecraft?

Type the command in the chat window and press the Enter key to run the command. This /fill command would replace all blocks in the fill region, including air. The replaced blocks will be dropped and can then be collected as if they were mined with a pickaxe or shovel.



Minecraft Java How To Save, Backup \u0026 Restore Your Minecraft Java World (Easy Tutorial)




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Evgenia Basyrova, Stanislav Kondratiev, Sinitta Leunen, Erik Mclean