If your procedure crashes the game when the procedure is called in some or all cases, you are probably using one of these procedure blocks (there are other blocks too, the common thing with these blocks is they have a special NULL marking):
These blocks can return an empty value (null), as the entity will not always have an owner, be attacking, or riding another entity.
If you use such block in a procedure with any action, for example like this (just example, any use without a check shown in the next section is problematic):
In case the "Event/target entity" will not be riding any entity, you will be setting the health of an entity that does not exist to 0 in this case, and this will inevitably lead to a crash.
Whenever you use such a block, you need to assure the entity you are looking for exists (is not NULL). To do this, you will need to check if your entity is one of the types you expect. The corrected procedure from the example above in case we want the procedure to run for any living entity type would be:
Now, we check if the entity "Event/target entity" is riding is of (sub)type EntityLiving (all animals, mobs, ...). The entity that is NULL is not a living entity, so in such case, this procedure will not run, and we will not be setting the health of a non-existent entity to 0 and the game will run happily.