You need to follow some step to connect NetBeans with your Moodle site.
1) Go to your NetBeans Click on File -> New Project.
2) Go to PHP click on "PHP Application with Existing Sources" then click Next.
3) Go to Sources Folder click on "Browse" then select your Moodle folder(it can find your server directory ).
4)Click on Finish.
If you want to create block follow below link.