If you are using intellij , try installing the minecraft development kit addon and then make a new project there
It will automatically get quite a bit of stuff done for you, while it "might not be good for beginner" (said by some people in spigot forum cuz you don't learn how to configure things properly), it actually does a lot of stuff perfectly for you , so just "copy homework".
The addon is self-intuitive enough so I wont guide you through how to use it here