I saw that you can call state:set_can_be_hurt on a state object. And in the parameter function you could probably check if the attacker is another hero, and then do nothing. But I'd have to set that on all the default states ("free", "running", "sword swinging" etc.), and I don't know where these states are created or stored. Does anyone know how I could get a handle on all the default states?