Events get evaluated from top to bottom every tick(frame)
In your case, jumping only works because it is placed on the bottom, if you were to place it on top it would also not work. What happens with your attack is likely that you press the button, attack animation starts playing and the next frame the player is "idle/moving/jumping" and the animation is overwritten.
There are different ways to handle it, for example, you can check if an animation is playing. So you could check "is animation attack NOT playing" and only then you switch it to move/idle.
I personally prefer to use a state machine, basically an instance variable on the player. Then you set this variable to a definitive state like "falling, jumping, attacking, crawling, dead" And based on that state you set the animation. This prevents overlaps like you have happening where a player is attacking AND idle.