• check_circle Functions
  • 2,529 views, 2 today
  • 91 downloads, 0 today
  • 3
  • 3
  • 4
Guilherme Cassel's Avatar Guilherme Cassel
Level 27 : Expert Miner
3
I Remade the previous version of my Emerald Bank! No more command blocks folks!

Now you can use it from wherever you want and you can use signs too if you want.

To get the Signs, you just need to run the command: /function bank:banksigns

To run a Withdraw 32 from wherever you want, type: /trigger withdraw

To run a Deposit 32 from wherever you want, type: /trigger deposit

To Deposit All your Esmeralds from your inventory from wherever you want, type: /trigger depositall

To Withdraw All your Esmeralds to your inventory from wherever you want, type: /trigger withdrawall

You may see some lag for a second if you withdraw all your emeralds at once.

If you have any suggestions, please reply.
CompatibilityMinecraft 1.15
toMinecraft 1.19
Tags

Create an account or sign in to comment.

1
03/29/2023 10:23 am
Level 6 : Apprentice Miner
cool-gal-98-infinity
cool-gal-98-infinity's Avatar
i like it
1
01/29/2023 3:50 am
Level 39 : Artisan Miner
Lordphenex
Lordphenex's Avatar
Yeah that's better !
However, you could give or take the 32 emeralds at once instead of giving them 1 by 1.
For deposits ;
execute store result score .emeraldNumber <Score> run clear @s emerald 0
execute if score .emeraldNumber <Score> matches ..31 run clear @s emerald
execute if score .emeraldNumber <Score> matches ..31 run scoreboard players operation @s emeralds += emeraldNumber <Score>
execute if score .emeraldNumber <Score> matches 32.. run clear @s emerald 32
execute if score .emeraldNumber <Score> matches 32.. run scoreboard players add @s emeralds 32

Same logic applies for withdrawal. You will just need a way to give player a certain amount of emeralds if they have less than 32 in bank. For that, you can use loot tables and set the count from a scoreboard (will only work for 1.17+). Alternatively, you can summon an item at player position and set its count from the score. Or you can use binary counting to give the proper amount back (the third method I presented here : https://www.planetminecraft.com/forums/minecraft/datapacks/tutorial-creating-dynamic-commands-based-on-score-attribute-tp-worldborder-xp-using-binary-count-666777/)
1
01/30/2023 2:37 pmhistory
Level 27 : Expert Miner
Guilherme Cassel
Guilherme Cassel's Avatar
I may be dumb but I wasn't able to use the score<=31 in the withdrawing commands

Like you cant use an score as an integer on the /give command..

.. Instead I made a looping command that actives when the player play withdraw with emeralds=..31, that will give 1 emerald and remove 1 from the score, and those 3 commands loop for some freacking hundred times untill the player Emeralds reaches 0 :/

And not mentioning this method on the whitdrawall functions haha, basically lag :D

But as in the first version, as I learn I'll try to remake the datapack in a better way
1
01/29/2023 8:24 am
Level 27 : Expert Miner
Guilherme Cassel
Guilherme Cassel's Avatar
Thanks it really helped, I'm still in the process of learning mcfunction..

I wasnt aware that I could use a fake player name to storage values on their scores, that's kinda usefull
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome