{"id":18325208,"url":"https://github.com/konijima/pz-libraries","last_synced_at":"2025-07-11T03:33:40.249Z","repository":{"id":41332538,"uuid":"429385791","full_name":"Konijima/PZ-Libraries","owner":"Konijima","description":"Complete tutorial to decompile and use Intellisense for Project Zomboid modder.","archived":false,"fork":false,"pushed_at":"2024-04-28T23:53:57.000Z","size":18619,"stargazers_count":67,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"Tutorial-v2","last_synced_at":"2025-04-06T00:32:01.932Z","etag":null,"topics":["intellij","projectzomboid","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Konijima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-18T10:25:56.000Z","updated_at":"2025-03-17T09:32:28.000Z","dependencies_parsed_at":"2025-04-06T00:31:15.013Z","dependency_job_id":null,"html_url":"https://github.com/Konijima/PZ-Libraries","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Konijima/PZ-Libraries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konijima%2FPZ-Libraries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konijima%2FPZ-Libraries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konijima%2FPZ-Libraries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konijima%2FPZ-Libraries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Konijima","download_url":"https://codeload.github.com/Konijima/PZ-Libraries/tar.gz/refs/heads/Tutorial-v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konijima%2FPZ-Libraries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264721589,"owners_count":23653960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intellij","projectzomboid","tutorial"],"created_at":"2024-11-05T18:37:07.743Z","updated_at":"2025-07-11T03:33:40.203Z","avatar_url":"https://github.com/Konijima.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PZ-Libraries\n\nIf you have trouble with the tutorial you can contact me on discord `Konijima#9279` or **open an issue**.  \nIf you have **suggestion** you can **fork** and create a **pull request**.\n\nHopefully I made this as easy as possible to understand.\n\n## Tutorial \n\n- Easy and fast source decompilation  \n- Intellisense using global libraries  \n- Easy source update\n- Quick search Java and Lua source\n\n\u003cbr\u003e\n\n# A) IntelliJ IDEA Community Edition\n|[Windows](https://www.jetbrains.com/idea/download/#section=windows)|[MacOS](https://www.jetbrains.com/idea/download/#section=mac)|[Linux](https://www.jetbrains.com/idea/download/#section=linux)|\n|---|---|---|\n\nInstall the IDE on your computer. Find resource online how to install on your specific OS if needed.\n\n\u003cbr\u003e\n\n# B) Pre-Setup\nInstall Capsid and run the configuration.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e1) Create a new project\u003c/b\u003e (used for decompiling only)\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e New \u003e Project...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e2) Setup the new project\u003c/b\u003e\u003c/summary\u003e\nWe will install Capsid in this new project to get the jar libraries and decompiled source.\u003cbr\u003e\nSo first, select \u003cb\u003eGroovy\u003c/b\u003e \u0026 \u003cb\u003eGradle\u003c/b\u003e.\nThen make sure to use Java 17, it should be default when installing IntelliJ.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_groovygradle.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e3) Installing Capsid with build.gradle\u003c/b\u003e\u003c/summary\u003e\nOnce the project is set, it should automatically open \u003cb\u003ebuild.gradle\u003c/b\u003e.\u003cbr\u003e\nAdd this line to the plugins table \u003cpre\u003eid 'io.pzstorm.capsid' version '0.4.2'\u003c/pre\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_addCapsid.png?raw=true\" /\u003e\u003cbr\u003e\nThen click on the Load Gradle Icon or press \u003cb\u003eCtrl + Shift + O\u003c/b\u003e to apply the changes.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e4) Expand the gradle tab\u003c/b\u003e\u003c/summary\u003e\nClick on the gradle tab on the right side of the window.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_expandgradletab.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e5) Create Run Configurations\u003c/b\u003e\u003c/summary\u003e\nExpand the \u003cb\u003eTasks \u003e build setup\u003c/b\u003e in the tree view.\u003cbr\u003e\nDouble click \u003cb\u003ecreateRunConfigurations\u003c/b\u003e task to execute it.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_createRunConfiguration.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e6) Enter path to game installation directory\u003c/b\u003e\u003c/summary\u003e\nDuring the create run configuration you will be prompt to enter the game installation directory.\u003cbr\u003eFind and paste the full path to where the game is installed on your machine.\u003cbr\u003eThis should be the same directory that contains the executable to run the game.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_setGameInstallDir.png?raw=true\" /\u003e\u003cbr\u003e\nThen press enter and wait for the task to complete.\n\u003cpre\u003eBUILD SUCCESSFUL in 9s\n2 actionable tasks: 2 executed\n1:50:45 PM: Execution finished 'createRunConfigurations'.\u003c/pre\u003e\nIn the case that you made a mistake, you can delete the file \u003cb\u003elocal.properties\u003c/b\u003e and run the task again.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e7) Install Emmylua plugin\u003c/b\u003e\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e Settings...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/install_emmylua_1.png?raw=true\" /\u003e\u003cbr\u003e\nThen go to \u003cb\u003ePlugins\u003c/b\u003e and search for \u003cb\u003eEmmylua\u003c/b\u003e.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/install_emmylua_2.png?raw=true\" /\u003e\u003cbr\u003e\nInstall it and \u003ca href=\"https://emmylua.github.io/\"\u003echeck the documentation to learn how it work\u003c/a\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n# C) Decompiling\nLet's get decompiling in a single step.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e1) Run Setup Workspace config\u003c/b\u003e\u003c/summary\u003e\nSelect the new configuration \u003cb\u003esetupWorkspace\u003c/b\u003e created from the previous step then Run it.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_setupWorkspace.png?raw=true\" /\u003e\u003cbr\u003e\nThis step will take some time (a couple minutes), it will decompile, annotate and create everything we need to start making mods.\u003cbr\u003e\nIt will run these tasks in this order \u003cpre\u003ezomboidJar, decompileZomboid, annotateZomboid, compileZomboid, zomboidLuaJar\u003c/pre\u003e\nWhen everything is complete you should see\n\u003cpre\u003e\nBUILD SUCCESSFUL in 217ms\n1 actionable task: 1 executed\n2:06:28 PM: Execution finished.\n\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n# D) Versioning\nLet's organise a little bit before we get to modding.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e1) Know the stuff that you need\u003c/b\u003e\u003c/summary\u003e\nSo first of all, there is a couple things that we will need.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_stuffWeWant.png?raw=true\" /\u003e\u003cbr\u003e\n\u003chr\u003e\n\u003cb\u003ebuild \u003e generated \u003e sources\u003c/b\u003e\u003cbr\u003e\nThis directory contains both the java and lua source code. We don't need it but we might want it to do quick search using any search tools that we prefer.\u003cbr\u003e\n\u003chr\u003e\n\u003cb\u003elib\u003c/b\u003e\u003cbr\u003e\nThis directory contains the 3 jar files that we will need to get the full power out of IntelliJ while developping mods.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e2) Create a directory to keep it organized\u003c/b\u003e\u003c/summary\u003e\nAnywhere in your computer, create a directory named \u003cb\u003ezomboid-decompiled\u003c/b\u003e.\u003cbr\u003e\nIn that directory create a new directory named with the current version of the game.\u003cbr\u003e\u003cbr\u003e\nCopy the 3 jar files into that new directory and optionally copy the \u003ci\u003ebuild/generated/sources\u003c/i\u003e directory.\u003cbr\u003e\nYou can rename the files to append the version for later.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_organize.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n# E) Setup a new/existing Project Zomboid Mod\nAlright we are almost there, you will be typing code soon i swear.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e1a) Create a new mod\u003c/b\u003e\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e New \u003e Project...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/CreateNewMod1.png?raw=true\" /\u003e\u003cbr\u003e\nNow select the zomboid local workshop directory and enter your new mod name.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/CreateNewMod2.png?raw=true\" /\u003e\u003cbr\u003e\nYou should now have an empty project ready to be setup.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/CreateNewMod3.png?raw=true\" /\u003e\u003cbr\u003e\nYou can delete the \u003cb\u003esrc\u003c/b\u003e directory and create your default workshop mod structure.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/CreateNewMod4.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e1b) Use an existing mod\u003c/b\u003e\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e Open...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/ExistingMod1.png?raw=true\" /\u003e\u003cbr\u003e\nSelect the mod you want to open with IntelliJ and click \u003cb\u003eTrust Project\u003c/b\u003e when prompted.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/ExistingMod2.png?raw=true\" /\u003e\u003cbr\u003e\nPress \u003cb\u003eCtrl + S\u003c/b\u003e to save the project and you are ready for the final step.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e2) Setup the global libraries\u003c/b\u003e (per version)\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e Project Structure...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/setup_libs_1.png?raw=true\" /\u003e\u003cbr\u003e\nThen select \u003cb\u003ePlatform Settings \u003e Global Libraries\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/setup_libs_2.png?raw=true\" /\u003e\u003cbr\u003e\nPress the \u003cb\u003e+\u003c/b\u003e icon and add both \u003cb\u003ezdoc-lua.jar\u003c/b\u003e and \u003cb\u003ezomboid.jar\u003c/b\u003e to your global libraries.\u003cbr\u003e\nThen select \u003cb\u003ezomboid.jar\u003c/b\u003e and press the other \u003cb\u003e+\u003c/b\u003e icon and add \u003cb\u003ezomboid-sources.jar\u003c/b\u003e.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/setup_libs_3.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e3) Setup the mod project modules\u003c/b\u003e\u003c/summary\u003e\nSelect \u003cb\u003eFile \u003e Project Structure...\u003c/b\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/setup_libs_1.png?raw=true\" /\u003e\u003cbr\u003e\nThen select \u003cb\u003eProject Settings \u003e Modules\u003c/b\u003e then \u003cb\u003eDependencies\u003c/b\u003e tab.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/project_modules.png?raw=true\" /\u003e\u003cbr\u003e\nAdd both global libraries.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/project_modules_2.png?raw=true\" /\u003e\u003cbr\u003e\nCheck both library boxes and apply.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/project_modules_3.png?raw=true\" /\u003e\u003cbr\u003e\nYou now have intellisense working in your project.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/Intelisense_1.png?raw=true\" /\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n# F) Search/Find tools\nNow you can search into the source and figure for yourself how things work.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSearch in the Java source code\u003c/b\u003e\u003c/summary\u003e\nRight-click the zomboid.jar root library in the external libraries part of your project file tree.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/search-java.png?raw=true\" /\u003e\u003cbr\u003e\nThen click \u003cb\u003eFind in files\u003c/b\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSearch in the Lua source code\u003c/b\u003e\u003c/summary\u003e\nRight-click the zdoc-lua.jar root library in the external libraries part of your project file tree.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/search-lua.png?raw=true\" /\u003e\u003cbr\u003e\nThen click \u003cb\u003eFind in files\u003c/b\u003e\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n# G) Project Zomboid has updated\nBut what if PZ updated to a new version?\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDecompiling a new PZ version\u003c/b\u003e\u003c/summary\u003e\nMake sure your Project Zomboid game has been updated.\u003cbr\u003e\nOpen the \u003cb\u003ecapsid project\u003c/b\u003e we used for decompiling the first time.\u003cbr\u003e\nRun the \u003cb\u003esetupWorkspace\u003c/b\u003e configuration again.\u003cbr\u003e\n\u003cimg src=\"https://github.com/Konijima/PZ-Libraries/blob/Tutorial-v2/Images/SetupCapsid_createNewProject_setupWorkspace.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eUpdating global libraries for the new version\u003c/b\u003e\u003c/summary\u003e\nGo back to \u003cb\u003esection E step 2 \u0026 3\u003c/b\u003e and do it again with the new generated jar files.\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonijima%2Fpz-libraries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonijima%2Fpz-libraries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonijima%2Fpz-libraries/lists"}