Oct
5
2019

Reading Minecraft World into Unity (using Substrate)

Minecraft terrain in unity!

Quick test for reading Minecraft worlds into unity.
Note: example code uses particle for each block, so it gets pretty slow.

Compile Substrate.dll:
– download this repository https://github.com/minecraft-dotnet/Substrate
– unzip, open Substrate-master\SubstrateCS\Substrate.sln
– Solution Explorer: Right click over Substrate (NET4), Set As Startup Project
– Select Release (from the configuration dropdown in toolbar, although default “Debug” works also)
– Press F5 to compile
– Should see message in output: “========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========”
– Go to the output folder (shown in the output window above that previous line)
– Copy “Substrate.dll” into your unity project, Assets/Plugins/Substrate/x64/ folder
– Note: You need to compile 64bit version (which should happen by default)

Minecraft:
– Start minecraft with 1.12.2 version (apparently substrate is designed up to that version?)
– Create new world, enter into it once, then can exit minecraft

Unity:
– Test with this script: https://gist.github.com/unitycoder/e0bb32b9d6ece0b4bde7be270e2e2a6f
– Add ParticleSystem into scene, then assign it to the script (see below for my particle system settings screenshot)

References / Resources:
– Block ID’s http://media.dinnerbone.com/uploads/2013-09/files/28_00-44-23_YfmAkomVI.txt

TODO
– Use mesh (instead of particles)
– Optimize..
– Load chunks-on-demand
– Add player
– Test with unity raytracing!

Using particles and loading 100 chunks is not the best idea..
Particle system settings (1)
Particle system settings (2)
Drawing air blocks (but instead can just skip them)

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch Instagram

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.