It didn't work. I got an error that I couldn't put annotations anywhere other than the line directly above the start of the code, in this case, above public static void registerEntityWorldSpawn.
I reread the article, and tried various things, but it's still not working.
First, I tried to do what was shown in the first example and put the code in public class staticForgeEventHandler and subscribe the event inside, but I got this:
After this didn't work, I tried to add that register thing at the end of the second example, but that didn't work at all.