#Kill Detector

1 messages · Page 1 of 1 (latest)

lofty fiber
#

your method is not working. first I will ask if you are making a shared datapack either for the map or for which server

lofty fiber
#

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"
      }
    }
  }
}
lofty fiber
#

yes

lofty fiber
#

it's predicate, right

#

I don't speak English

#

you don't need to add lines, but call the function

lofty fiber