Updated entity cast to for loop in myspawn