Pretty sure @SubscribeEvent is part of Forge, not Java. It wasn't covered in the tutorials I found online. However, if you could recommend a video or something of how to use @SubscribeEvent, that would be great. I searched for some on YouTube and I was only able to find tutorials on Event Listeners and stuff.
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.