{"id":18878961,"url":"https://github.com/ddozzi/mixin-tutorial","last_synced_at":"2025-04-14T19:10:28.185Z","repository":{"id":251653143,"uuid":"388004640","full_name":"ddozzi/mixin-tutorial","owner":"ddozzi","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-29T22:07:50.000Z","size":43,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-04T20:52:13.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddozzi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-21T05:31:26.000Z","updated_at":"2024-08-04T20:52:23.994Z","dependencies_parsed_at":"2024-08-04T21:09:02.598Z","dependency_job_id":null,"html_url":"https://github.com/ddozzi/mixin-tutorial","commit_stats":null,"previous_names":["ddozzi/mixin-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddozzi%2Fmixin-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddozzi%2Fmixin-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddozzi%2Fmixin-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddozzi%2Fmixin-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddozzi","download_url":"https://codeload.github.com/ddozzi/mixin-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223643181,"owners_count":17178587,"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":[],"created_at":"2024-11-08T06:31:35.249Z","updated_at":"2024-11-08T06:32:51.503Z","avatar_url":"https://github.com/ddozzi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"### this tutorial is no longer being maintained!\n### for a more up-to-date and in-depth tutorial, check out [my new tutorial!](https://ddozzi.gitbook.io/mixin-tutorial/how-to-make-a-mixin-client/) \n### thanks for all the support!\n\n# Mixin Tutorial - INTELLJI\nI haven't seen any decent mixin tutorials, so here's one.\n\n## Topics\n\n- Setting up your first mixin project\n- Creating your first mixin\n\n## Setup\n\nCreate a new folder where ever you want your client to be. \n![Example Client](https://user-images.githubusercontent.com/69029714/126436967-facffba9-a63e-4c8a-9cd6-3837cfe62a44.png)\n\nOpen up IntelliJ. Then click `New Project \u003e Gradle \u003e Next`. Set the `Location` to the folder you just created\n![EC INTELLIJ](https://user-images.githubusercontent.com/69029714/126437646-557d291c-851d-424f-87ca-062d79c3461b.png)\n\n\n\nCopy and paste the ![build.gradle](https://github.com/ddozzi/Mixin-Tutorial/blob/main/build.gradle) into your `build.gradle`.\n![EC INTELLIJ 2](https://user-images.githubusercontent.com/69029714/126437757-62a7b876-785b-41d4-928d-04e841f3685a.png)\n\nThen click the \"Load Gradle Changes\" Button on the top right.\n![refresh button](https://user-images.githubusercontent.com/69029714/126437993-ae1b7358-0335-4651-8cb5-1fdc0d716383.png)\n\nYou might be noticing an error popping up in the bottom half, that's totally normal. It's because forgegradle doesn't support newer versions of gradle.\n\n![Screen Shot 2021-07-21 at 1 52 50 AM](https://user-images.githubusercontent.com/69029714/126438050-42e89148-3242-44b7-8c84-c977efb74350.png)\n\nTo fix this, go to `gradle \u003e wrapper \u003e gradle-wrapper.properties` then replace whatever version is currently there, with 4.7\n\n\nhttps://user-images.githubusercontent.com/69029714/126439227-39686823-fe4f-49fe-bb84-0a86235286c0.mov\n\n\nNow for the lengthy part. Replace all the \"example\" strings with your client name. Also replace the \"net\" packages with whatever fits you. An example is shown below.\n\n**! This MUST be done for all instances. DO NOT CHANGE ANY OF THE \"mixin\" OR \"mixins\" strings !**\n\n\nOnce you are done, click the gradle button on the far right. Then click `Tasks \u003e forgegradle \u003e setupDecompWorkspace`. This will take some time.\n![Screen Shot 2021-07-21 at 2 09 49 AM](https://user-images.githubusercontent.com/69029714/126439713-851590a2-9733-4ee3-8645-89234d3528e6.png)\n\nOnce that process is finished, click `Tasks \u003e forgegradle \u003e genIntellijRuns`\n![Screen Shot 2021-07-21 at 2 10 32 AM](https://user-images.githubusercontent.com/69029714/126439793-ecbd06b3-632c-44e3-b28d-a43684b6db8f.png)\n\nClick the button at the top then click `Minecraft Client` An example is shown below.\n\nhttps://user-images.githubusercontent.com/69029714/126440150-9632bb22-8278-467e-ad86-425d15ffa2ec.mov\n\nClick the same button again, then click `Edit Configurations`. You will see an error saying \"Class 'GradleStart not found in module 'ExampleClient'\". \nTo fix this, set the `Client` to `Client.main`.\n\nhttps://user-images.githubusercontent.com/69029714/126440865-81519283-7a34-4d12-bf6f-ea14ba94192d.mov\n\nClick Apply. The error should be gone now.\n\n\n\n## Tweaker\n\nCreate a new package in `src/main/java` with the package name you've set in your `build.gradle` in this case, it would be `net.example`\n\nCreate a new package named `mixins` inside the previous pacakge then create a new `java` file with whatever you named your tweaker. In this case, it's `ExampleTweaker`. \n\n\n\n**Copy the code from this ![tweaker](\"https://github.com/ddozzi/Mixin-Tutorial/blob/main/ExampleTweaker.java\") to yours.**\n\nReplace the `example` at `Mixins.addConfiguration(\"mixins.example.json\");` (inside your tweaker) with your client name or whatever you named your package.\n\n\nSo far, your project should look something like this: \n\n![Screen Shot 2021-07-21 at 2 28 07 AM](https://user-images.githubusercontent.com/69029714/126441740-f74f0274-1c95-4f0d-b609-fd847934db75.png)\n\n\n\n## Mixin Time!\n\nNow it's time to make your first mixin!\n\nCreate a new file named whatever was inside your `Mixins.addConfiguration(\"mixins.example.json\");` inside the resource folder.\n\n![Screen Shot 2021-07-21 at 2 36 44 AM](https://user-images.githubusercontent.com/69029714/126442702-69b7a10f-67be-4dea-9216-366b89469599.png)\n\nThen, copy the json from ![here](\"https://github.com/ddozzi/Mixin-Tutorial/blob/main/mixins.example.json\") into the json file you just created.\n\nOk, now it's time to create an actual mixin.\n\nCreate a package named `client` inside the package where your tweaker is located.\n\nThen, inside that `client` package, create a java file named `MixinMinecraft`\n\n![Screen Shot 2021-07-21 at 2 39 38 AM](https://user-images.githubusercontent.com/69029714/126443045-7ea64cde-02c6-423a-ae11-704d9292b7b6.png)\n\nthen add this mixin code: \n\n```java\n@Mixin(Minecraft.class)\npublic class MixinMinecraft {\n    @Inject(method = \"createDisplay\", at = @At(\"RETURN\"))\n    public void createDisplay(CallbackInfo callbackInfo) {\n        Display.setTitle(\"Example Client | 1.8.9\");\n    }\n}\n```\n\n\nCongrats! You've made a mixin client for 1.8.9! For more guidance, join the spongepowered ![discord](\"https://discord.gg/sponge\") and check out this ![cheatsheet](\"https://github.com/2xsaiko/mixin-cheatsheet\")\n\n**Having issues? Feel free to contact me on discord (ddozzi#6190), the code is also available ![here](\"https://github.com/ddozzi/Mixin-Tutorial-Code/tree/main\")**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddozzi%2Fmixin-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddozzi%2Fmixin-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddozzi%2Fmixin-tutorial/lists"}