#Kill Detector
1 messages · Page 1 of 1 (latest)
ID System
armor_stand teleports to the pig, if the pig is gone, then armor_stand will be killed
load
scoreboard objectives add main_score dummy
scoreboard objectives add YOUR_ID dummy
tick
execute as @e[type=armor_stand,tag=model] run function id_tp_model
id_tp_model
## copy the id to the fake player
scoreboard players operation *id_test main_score = @s YOUR_ID
## teleport @s to a pig that has a predicate for comparing scores
tp @s @e[type=pig,tag=body,limit=1,predicate=same_ids]
## but if there is no pig that has a predicate for comparing the scores, then @s is killed
execute unless entity @e[type=pig,tag=body,limit=1,predicate=same_ids] run kill
predicate same_ids
{
"condition": "minecraft:entity_scores",
"entity": "this",
"scores": {
"YOUR_ID": {
"min": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": "*id_test"
},
"score": "main_score"
},
"max": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": "*id_test"
},
"score": "main_score"
}
}
}
}
yes
it's predicate, right
I don't speak English
you don't need to add lines, but call the function
in the id_tp_model function in the most recent command, you need to specify a function instead of the kill command. the function also contains the kill command and the commands you need