The Meaning of Life, the Universe, and Everything.
Join Date:
2/11/2017
Posts:
662
Member Details
On my realms server, I have a villager called Guard. His job is to stand around and give people wither if someone damages anyone nearby. If he kills someone, he's supposed to mark them as a criminal by changing the score "criminal" by 1. That part is what I need help with. I have put all the guards on team blue and added a score called killedByGuard which counts how many times each player got killed by an entity on the blue team. Currently, the score is not incrementing. I did some testing and brought it down to one of 2 different things happening.
For some reason, the game doesn't count the player dying from an effect originating from the villager as the villager killing the player.
When the player dies, the command block no longer loops through it with target selectors
I'm not sure which one it is, and I don't know how to fix either. Here's my code (damage is how much damage the player has dealt):
Run Every tick
/execute as @e[tag=guard] at @s run effect give @a[distance=..20,scores={damage=1..}] wither 3 60 true
/scoreboard players set @a damage 0
/execute as @e[type=villager,tag=guard] run data merge entity @s {CareerLevel:1,Motion:[0.0,0.0,0.0]}
/team join Guards @e[tag=guard]
/execute as @a[scores={killedByGuard=1..}] run scoreboard players add @s criminal 1
(Conditional)
/tellraw @a[scores={killedByGuard=1..}] ["",{"text":"You were naughty, so you are now a ","color":"black"},{"text":"criminal","color":"red"},{"text":"!","color":"black"}]
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.
Yeah, it's not possible to be killed by a villager, and running effects won't count towards that either. There are other ways to accomplish what you're going for, however I have a small suggestion.
As is, whether the player is labeled a criminal or not is dependent on them dying from an effect given after they deal damage to other entities. This seems to mean that as long as they keep their health up and never die, they are free to hurt and kill other things as much as they please. Perhaps this could be changed to a system wherein every time they cause damage, they receive 1 to some objective called "Crimes" or something. Once that reaches x amount of points, then they are marked as a criminal.
Yeah, it's not possible to be killed by a villager, and running effects won't count towards that either. There are other ways to accomplish what you're going for, however I have a small suggestion.
As is, whether the player is labeled a criminal or not is dependent on them dying from an effect given after they deal damage to other entities. This seems to mean that as long as they keep their health up and never die, they are free to hurt and kill other things as much as they please. Perhaps this could be changed to a system wherein every time they cause damage, they receive 1 to some objective called "Crimes" or something. Once that reaches x amount of points, then they are marked as a criminal.
That's a good idea. I will try implementing it.
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.
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.
On my realms server, I have a villager called Guard. His job is to stand around and give people wither if someone damages anyone nearby. If he kills someone, he's supposed to mark them as a criminal by changing the score "criminal" by 1. That part is what I need help with. I have put all the guards on team blue and added a score called killedByGuard which counts how many times each player got killed by an entity on the blue team. Currently, the score is not incrementing. I did some testing and brought it down to one of 2 different things happening.
I'm not sure which one it is, and I don't know how to fix either. Here's my code (damage is how much damage the player has dealt):
Run Every tick
/execute as @e[tag=guard] at @s run effect give @a[distance=..20,scores={damage=1..}] wither 3 60 true
/scoreboard players set @a damage 0
/execute as @e[type=villager,tag=guard] run data merge entity @s {CareerLevel:1,Motion:[0.0,0.0,0.0]}
/team join Guards @e[tag=guard]
/execute as @a[scores={killedByGuard=1..}] run scoreboard players add @s criminal 1
(Conditional)
/tellraw @a[scores={killedByGuard=1..}] ["",{"text":"You were naughty, so you are now a ","color":"black"},{"text":"criminal","color":"red"},{"text":"!","color":"black"}]
(Not Conditional)
/scoreboard players set @a killedByGuard 0
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
Yeah, it's not possible to be killed by a villager, and running effects won't count towards that either. There are other ways to accomplish what you're going for, however I have a small suggestion.
As is, whether the player is labeled a criminal or not is dependent on them dying from an effect given after they deal damage to other entities. This seems to mean that as long as they keep their health up and never die, they are free to hurt and kill other things as much as they please. Perhaps this could be changed to a system wherein every time they cause damage, they receive 1 to some objective called "Crimes" or something. Once that reaches x amount of points, then they are marked as a criminal.
That's a good idea. I will try implementing it.
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
I have been able to implement this idea successfully.
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
Good to hear