here is the code I want to run every time a non player entity dies
But for some reason not every time does it run and it offsets my variable
on death:
type of victim is not player:
{dfdspawned::%world of victim%} > 0:
remove 1 from {dfdspawned::%world of victim%}
if {dfdspawned::%world of victim%} = 0:
send "&8[&6Dungeon&8] &7You have found a key... Where does it lead?" to all players in world of victim
if metadata value "melee" of victim is true:
drop 20 exp at location of victim
if metadata value "rusty" of victim is true:
drop 15 exp at location of victim