I have a game I'm creating and I'm trying to spawn new wolves randomly into my game when they die I really need some help. I have some experience with Greenfoot I'm not a 100% beginner.
Not very sure on what you mean by "when they die." When they all die, or when one dies? There are some ways, i.e. executing the command from the thing that would kill it (only if one of those said things are killing it, or else you'd be making a bunch of superclasses or pasting the same code everywhere).
You could spawn one into the world at the time one dies. A reference to the world is needed before you can add the new one. So, it must be gotten before removing the one that dies. However, since you are not actually changing the number of wolves in the world, it would be better to just relocate the dying wolf as if it was the new one. If it holds any values that change throughout its existence, they need to be reset.
As an alternative that provides more behavioral options, you can have the World class act method maintain a certain number of wolves in the world. Just remove the wolf that dies in the Actor subclass, as normal. Then, in the World class act method, add code to check the number of wolves in the world and if not up to your limit, add one. You could even delay the adding using a random chance to the condition of adding one.