This is a minimal Rift project. The only use of it is to be copied to start a new project.
- OpenJDK 8. Currently Minecraft doesn't support Java 9 and above.
-
Development:
./gradlew setupDecompWorkspace [eclipse,idea]
After this, import in your IDE as Gradle project.
-
Build:
./gradlew build
Important files in MDK:
src / main / java / # code
src / main / resources /
riftmod.json # what classes to instantiate and call
pack.mcmeta # resource pack description
assets / modid / # blockstates/, sounds/, textures/, etc
run / # dev env runs here; screenshots/, mods/, etc
build / # build files
libs / # compiled archives
build.gradle # how to build & dependencies
From there, you'll probably want to change a few things:
-
build.gradle
/* rest omitted */ group 'example' // your root package, e.g. 'org.dimdev.halflogs' version '1.0' archivesBaseName = 'Example'
-
src/main/resources/riftmod.json
{ "id": "example", "name": "Example", "authors": [ "ExampleAuthor" ], "listeners": [ "example.ExampleListener" ] }
To load listener only on specific side or to change loading order:
{ "listeners": [{ "class": "example.ExampleListener", "side": "client", "priority": 10 }] }
Inner classes require
$
instead of.
, e.g.example.Example$InnerClass
. -
pack.mcmeta
{ "pack": { "pack_format": 4, "description": "Example" } }
This description is shown at Select Resource Packs screen. If mod doesn't have any resources, you can safely delete this file.
-
Changing
src/main/java
tosrc
andsrc/main/resources
toresources
:sourceSets { main { java.srcDirs = ['src'] resources.srcDirs = ['resources'] } }
-
Running Server under Eclipse:
Open Launch Configurations, select yourmod_client, switch to Arguments tab, change program arguments from...Client...
to...Server...
:--tweakClass org.dimdev.riftloader.launch.RiftLoaderServerTweaker