The Meaning of Life, the Universe, and Everything.
Join Date:
2/11/2017
Posts:
662
Member Details
I am trying to create an algorithm that allows 1 player to specify a specific player id and an amount to pay them, and it removes the money from the first player and adds the money to the second player.
I have set up the following scores:
id - the id of the player. Used to target a specific player from user input, as you cannot use an actual username that a player inputs.
target - the person the player wants to pay. Players use a written book with click events to manipulate this variable.
donation - the amount you want to pay the second player
money - the amount of money the player currently has
The command is run as the first player.
I currently have this command written, which charges the first player the amount that they wanted to donate.
/execute if score @s money >= @s donation run scoreboard players operation @s money -= @s donation
My problem comes when trying to make the transaction between players. This is as far as I got:
/execute as @a if score @s id =
I cannot define what that next target selector will be because I am running as the second player now. Before, I simply used the @s because I was running as the first player. I need to somehow trace the target id back to the first player.
Rollback Post to RevisionRollBack
Remember those versions that minecraft pranked us with? Specifically:
Minecraft 2.0
Minecraft 1.VR-Pre1
Snapshot 15w14a
Minecraft 3D
Those are still downloadable! Watch this video for 2.0:
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/11/2017
Posts:
662
Member Details
Nevermind. I solved it.
I realized that when I run a command as an entity, it does not actually change the position of the command run. Because I am running the command as the original player, I can use "@p" and be sure that I have the right player, because the command is being run exactly 0 blocks away from that player.
Rollback Post to RevisionRollBack
Remember those versions that minecraft pranked us with? Specifically:
Minecraft 2.0
Minecraft 1.VR-Pre1
Snapshot 15w14a
Minecraft 3D
Those are still downloadable! Watch this video for 2.0:
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
I am trying to create an algorithm that allows 1 player to specify a specific player id and an amount to pay them, and it removes the money from the first player and adds the money to the second player.
I have set up the following scores:
id - the id of the player. Used to target a specific player from user input, as you cannot use an actual username that a player inputs.
target - the person the player wants to pay. Players use a written book with click events to manipulate this variable.
donation - the amount you want to pay the second player
money - the amount of money the player currently has
The command is run as the first player.
I currently have this command written, which charges the first player the amount that they wanted to donate.
/execute if score @s money >= @s donation run scoreboard players operation @s money -= @s donation
My problem comes when trying to make the transaction between players. This is as far as I got:
/execute as @a if score @s id =
I cannot define what that next target selector will be because I am running as the second player now. Before, I simply used the @s because I was running as the first player. I need to somehow trace the target id back to the first player.
Remember those versions that minecraft pranked us with? Specifically:
Those are still downloadable! Watch this video for 2.0:
https://www.youtube.com/watch?v=PQdu9LKAdIU
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
15w14a is on this link:
http://minecraft.gamepedia.com/15w14a
1.RV-Pre1 is here:
http://minecraft.gamepedia.com/1.RV-Pre1
Minecraft 3D is here:
https://minecraft.gamepedia.com/Java_Edition_3D_Shareware_v1.34
Nevermind. I solved it.
I realized that when I run a command as an entity, it does not actually change the position of the command run. Because I am running the command as the original player, I can use "@p" and be sure that I have the right player, because the command is being run exactly 0 blocks away from that player.
Remember those versions that minecraft pranked us with? Specifically:
Those are still downloadable! Watch this video for 2.0:
https://www.youtube.com/watch?v=PQdu9LKAdIU
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
15w14a is on this link:
http://minecraft.gamepedia.com/15w14a
1.RV-Pre1 is here:
http://minecraft.gamepedia.com/1.RV-Pre1
Minecraft 3D is here:
https://minecraft.gamepedia.com/Java_Edition_3D_Shareware_v1.34