every 30 second: loop all cows: loop all players: if {pet::%loop-player%} is set: if name of loop-cow is "%{petnazwa::%loop-player%}%": loop players in radius 100 of loop-cow: set {teleport::%loop-player-1%} to location of loop-player-1 teleport loop-cow to {teleport::%loop-player-1%} every 1 second: loop all entities: loop all cows: loop all players: if loop-entity-1 is player: stop if name of loop-cow is "%{petnazwa::%loop-player%}%": loop entities in radius 5 of loop-cow: damage loop-entity-2 by {krowa::damage::%loop-player%} hearts on death: if victim is a cow: heal the cow