User Tools

Site Tools


ko_kr:tutorial:setup

This is an old revision of the document!


모드 개발 환경 구축하기

모드 개발에 필요한 도구들

모드 스타트업

마인크래프트 Fabric 모드를 개발 시작하는 방법은 2가지가 있습니다. 수동으로 개발 환경을 구축하거나, 프로그램을 실행시켜서 알아서 개발 환경을 구축하게 하실 수 있습니다.

수동적 방법

  1. LICENSEREADME.md는 빼고 fabric-example-mod에 있는 모든 파일을 복사하세요 (Kotlin을 사용하고 싶으시다면 이 Kotlin버전을 복사하세요).
  2. Edit gradle.properties:
    • Make sure to set archives_base_name and maven_group to your preferred values.
    • Make sure to update the versions of Minecraft, the mappings and the loader - all of which can be queried through this website - to match the versions you wish to target.
    • Add any other dependencies you plan to use in build.gradle.
  3. Import the build.gradle file to your IDE. You may refer to the next section for specific IDE's.
  4. Happy modding!

You can generate the Minecraft sources for reference (since IDEA already has a decompiler this is only useful for searching through the code) : Run the genSources Gradle task. If your IDE doesn't have Gradle integration, then run the following command in the terminal: gradlew genSources (or ./gradlew genSources on Linux/MacOS).

IntelliJ IDEA

If you are using IntelliJ IDEA by JetBrains, please follow these steps:

  1. In the IDEA main menu, select 'Import Project' (or File → Open… if you already have a project open).
  2. Select the project's build.gradle file to import the project.
  3. After Gradle is done setting up, close (File → Close Project) and re-open the project to fix run configurations not displaying correctly.
  4. (If the run configurations still don't show up, try reimporting the Gradle project from the Gradle tab in IDEA.)

Optional, but recommended: By default, IntelliJ delegates to Gradle to build the project. This is unnecessary for Fabric and causes longer build times and hotswapping related weirdness, among other problems. To make it use the builtin compiler:

  1. Open the 'Gradle Settings' dialog from the Gradle tab.
  2. Change the 'Build and run using' and 'Run tests using' fields to 'IntelliJ IDEA'.
  3. Go to File → Project Structure → Project and set 'Project compiler output' to $PROJECT_DIR$/out.

Unfortunately, it is currently impossible to set an IDE-wide default for the 'Build and run using' and 'Run tests using' options, so these steps have to be repeated for every new project.

NOTE: Don't run ./gradlew idea as it messes up with gradle and breaks develop environment.

이클립스

만약 이클립스를 사용하고 계신다면 gradlew eclipse를 실행하세요.

Visual Studio Code

If you are using VSCode by Microsoft, please follow these instructions

MinecraftDev IntelliJ IDEA 플러그인

If you are using IntelliJ IDEA you can use the MinecraftDev plugin. This plugin adds support for automatically generating Fabric projects as well as some mixin related features like inspections, generating accessors/shadow fields, and copying Mixin Target References (JVM Descriptors). The plugin can be found in the IntelliJ plugin repository, so you can install it using IntelliJ's internal plugin browser by navigating to File → Settings → Plugins, then clicking the Marketplace tab and searching for Minecraft.

Generator

If you are unable to use the MinecraftDev plugin or the fabric-example-mod repo, you may also use GeneratorFabricMod by ExtraCrafTX, a convenient tool to automatically generate new fabric mods from template. Follow these steps:

  1. Download latest release of GeneratorFabricMod here and extract them.
  2. Make a new directory, then run a command shell there and type path/to/GeneratorFabricMod/bin/GeneratorFabricMod.
  3. After letting it get its dependencies, follow the instructions and input required information.
  4. You're now done, just open the project folder with in your IDE.

모드 개발 기초

아이템이나 블록을 한번 추가해 보세요. 마인크래프트를 재시작 하지 않고도 변경 사항을 적용하는 방법이 필요하실 수 있으니 참고로 읽어보세요.

조언

  • While Fabric API is not strictly necessary for developing mods, its primary goal is to provide cross-compatibility and hooks where the game engine does not, and as such it is highly recommended! Even some of the tutorials on the wiki implicitly require Fabric API.
  • Occasionally, with development of fabric-loom (our Gradle build plugin) issues may crop up which require resetting the cache files. This can be done by running gradlew cleanloom. Running gradlew --stop can also help with a few rare issues.
  • Don't hesitate to ask questions! We're here to help you and work with you to make your dream mod a reality.

문제점 해결

소리가 없는 문제

때때로 IDE를 통해 gradle 프로젝트를 불러올때, 에셋이 제대로 다운로드 되지 않을 때가 있습니다. 이럴 때는, downloadAssets task를 직접 실행하거나 IDE의 Gradle 메뉴를 이용해 task를 실행하거나, 간단하게 커맨드 쉘(cmd, powershell, bash 등등)을 통해 gradlew downloadAssets를 실행하면 해결됩니다.

ko_kr/tutorial/setup.1613545707.txt.gz · Last modified: 2021/02/17 07:08 by namutree0345