A Minecraft client implementation made with Unity.
CornCraft is a Unity version of Minecraft. It connects to vanilla/plugin servers(version 1.16.2 to 1.20.4) and provides basic graphical gameplay support.
This project does not mean to be a Minecraft "clone", but rather an attempt to recreate the game in a somewhat different way, with the overall look and feel distinct from the original one.
It is based on another open source project, Minecraft Console Client (MCC), and incorporates this project as a foundation for cross-version networking with Minecraft servers. However, due to different runtime backends(Mono for Unity vs .NET for MCC) and other major parity issues regarding input and rendering, it is not an option to directly use MCC code as a library despite the fact that they're both in C#, and a number of tweaks and rewrites were needed for everything to work fine in this new framework. Currently there's no pre-built binaries available yet because some core features are still missing, but feel free to give it a try in the editor!
Important! It is NOT recommended to join a public/commercial server with CornCraft, and CornCraft is NOT responsible for server banning due to using this client! The best and safest way to play with this client, at least for now, is to set up a local server and play it with your friends.
The code CornCraft uses to parse vanilla resource packs is also open source as a Unity package called CraftSharp-Resource. Check it out if you want to make a Minecraft structure viewer, map editor or something like that with Unity.
Recommended server versions for CornCraft are 1.16.5
, 1.17.1
and 1.18.2
, both vanilla servers and plugin servers like Spigot are supported.
When setting up a server for CornCraft, it is recommended to set the allow-flight
option to true
in server.properties
file, otherwise it's likely you'll be kicked from the server when moving around(because CornCraft does not and likely will not simulate vanilla player physics, it uses Unity's physics system).
For 1.19.1
or higher servers, it is also necessary to set enforce-secure-profile
to false
so that CornCraft can log in correctly.
The project is made and tested with Unity 2022.3.50f1, so it is recommended to use this version(or newer) of Unity to build this game.
Some third-party assets are not included in this repo, for more information please see here.
Resource files will now be automatically downloaded if they're not present, so manual downloading is no longer necessary.
Most basic controls in CornCraft are similar to vanilla Java Edition. They're hard-coded for now, but will be configurable in the future. Here's a list of currently supported actions:
Key | Action |
---|---|
W / A / S / D | Move Horizontally |
Space | Move Up in Air (Jump if Grounded) |
Left Shift | Move Down in Air |
Left Ctrl | Toggle Walk/Rush Mode |
Mouse Scroll | Select Hotbar Slot |
F | Swap Items on Hands |
R | Toggle Camera Focus Lock (if in Grounded State) |
X | Perform Interaction |
F3 | Toggle Debug Info |
F3 + F4 (Hold) | Show Game Mode Switch |
F5 + C | Rebuild Chunks |
F5 + L | Update Global Illumination |
F6 / F7 / F8 | Load Previous/Reload/Load Next Player Model |
F11 | Toggle Fullscreen |
Shift + Tab | Switch to Next Camera Controller |
Shift + Mouse Scroll | Adjust Camera Zoom |
T / / | Show Chat Screen/Input Command |
P | Show Packet Inspector Screen |
Tab | Command Auto-Completion |
Esc | Pause Game |
Like MCC, CornCraft adopts CDDL-1.0 as the license of its code repository, and this license applies to all source code except those mention their author and license or with specific license attached.
Some other open-source projects/code examples are used in the project, which don't fall under CDDL-1.0 and use their own licenses. Here's a list of them:
- Welai Glow Sans: Used as font for regular game UI
- Cascadia Code/Mono: Used as font for command/technical information
- Star Rail NPR Shader: Anime character shaders for custom player render
- Minecraft Data: Protocol data for packet inspection
More information about CDDL-1.0 can be found on MCC's home page, in the license section, and the full license can be viewed here.