so i'm working on a script where you give your cat a totem of undying and it makes it invincable, and using an example i got both the item and the identifying the entity done, but when i try and check the entity's owner all i get is an undefined response.
onEvent('item.entity_interact', event => {
if(event.target.type == "minecraft:cat" && event.item.id == "minecraft:totem_of_undying"){
event.player.tell(event.target.owner) // this gives the error
if(event.target.owner == event.player.id){
//make invincable
}
}
})