Hacking Minecraft Tutorial 1
Rhino in Minecraft Tutorial: Introduction to Workflow
Links:
Rhino 8 Downloads Page - Link for procuring Rhino and Grasshopper.
Tutorial for using Datapacks - Link for building the folder structure that, when coupled with grasshopper will allow for speedy updated commands.
Food for Rhino (Grasshopper Plug-Ins) can be found here:
Tutorial on how to install grasshopper plug-ins - Basic tutorial showing a the best practice for grasshopper plug-in download and install.
EleFront 5.2.0 - Select Geometry Pipelines and graphical nodes.
Human for Rhino 6 - Good all around suite of nodes.
Pufferfish 3.0.0 for Rhino 8 - Parametric tool in Grasshopper.
WombatGH most recent - Has our file read and write nodes for modifying our datapack functions.
Rhino File:
Tutorial 1 - Base Rhino file for the most robust Minecraft Block Instantiation.
Grasshopper Script:
Tutorial 1 - Base script for the most robust Minecraft Block Instantiation.
Minecraft Wiki Links:
Minecraft Wiki Commands - Link to commands list for Minecraft.
Minecraft Wiki Blocks - Link to block list for Minecraft.
Scroll to data values for your identifier name.
Step-by-step:
-
Make sure that you are in a Minecraft world in creative mode is turned on and Cheatsmode is turned on.
- Transformations in Cartesian Coordinate Space. Minecraft F3 to see Minecraft coordinates - move around to understand which coordinates change and positive/negative in each direction. In rhino you get a helpful cartesian navigation in the lower right hand corner of perspective views that helps orient you.
- Brief note about the XYZ axis of Rhino is XZY in Mincraft, with Y being the elevation axis.
- Test a block command in the command window to place a block nearby. Confirm that you are typing in the right coordinates. See minecraft wiki page for specific commands. (i.e. /fill) /fill is good for our purposes because it prompts us to place a material in a coordinate space. Then look up your identifier by going to Minecraft Wiki Blocks, selecting the block you’d like to place, and scrolling down to find it’s data identifier (i.e. Acacia Wood’s identifier is “acacia_wood”). So to place a block in Minecraft with a command you plug in:
/fill acacia_wood x-coordinate y-coordinate z-
coordinate
(yes, this is the order of the coordinates, even though Y and Z are switched )
- So now that we can instantiate one block, we need to set up the apparatus for many many blocks that we don’t have to type, or even copy and paste. Download Rhino 8 and download and install the asscociated list of food4rhino. You should be able to do this by opening Rhino, then navigating to tools>grasshopper, and once this opens navigating to navigating to file>special folders>components folders and dropping the food4rhino files from downloads into this components folder (you may also need to unblock these files by right clicking on each icon>properties>attributes and checking the box marked “unblock” ). Then close and reopen Rhino 8 and they should be installed. See tutorial on downloading and installing food4rhino.
- Follow the Datapacks Tutorial to the letter, making sure you are looking up your verion of minecraft and placing that in the code where the tutorial specifies. Set up a function with a name you like that you can add in the visual studio.
- First open “Tutorial 1.3dm”. Rhino is a robust 3D modeling software, much like Autocad, Sketchup, Blender, etc. but much better! This is basically a new rhino file, all I’ve done is set you in presetup file in meters (Minecraft’s base unit) and in the layer that the grasshopper script will easily connect to. Learning to navigate this software will help this process. More tutorials on this later.
- Now open the “Tutorial 1.gh” file by going to the Tools tab>grasshopper, and then after that loads, in the grasshopper window that just popped up you are going to right click on file, new> and select it from where you saved it on your machine.
- It will probably pop-up with a question about installing missing food4rhino, hit download and install, and if it keeps asking you, just hit the other option (it should let you proceed to the script)
- A quick rundown of the script:
1. Zoom in and out until you see the full extent of the nodes - you should see an upper left hand corner hatched - this corner is the center of the grasshopper script.
2. In the hatched are I have two back of house groups the “Block Origin” group creates a voxel mesh about a point that doesn’t need to change (this will get moved to every point you instantiate and you can preview.). There is also a “Warning Compiler” that in instances where dabbling in high volumes of points, it tries to catch you before you crash minecraft or rhino/grasshopper.
3. In the upper left corner of the unhatched region we have “Input geometry from Rhino” which takes all the geometry in the layer titled “Geometry” in rhino and allows you to sort by type. We are just taking points for now, because that’s all we’ll want to try to speak to Minecraft.
4. Below this is a “Note” and a group called “Minecraft Working Origin” you will want to use this. So make sure the toggle says “True” (click on the button if it says “False” and this will be rectified)and in Minecraft hit F3 and find the coordinate in your minecraft world you would like to be your working origin and plug it in X/Y/Z in the sliders (you can double left click to insert your precise values). I’ve crossed these to translate your Minecraft coordinate values into what you want to see and work with in Rhino and later translate them back to Mincraft coordinates.
5. Scrolling up and right to the “Rounder” this group takes any point data that is non-integer and rounds it so we are seeing what will actually appear in Minecraft in rhino.
6. Scrolling right from this, the “Previewer” shows you where your blocks will go. You can change the color by double left clicking on the swatch color. This is helpful if you’ve copy/pasted a bunch of these and need to distinguish between say earth, stone, and water. The preview can be turned on and off with the “Preview On” toggle setting it to True/False.
7. Below this we have the “Minecraft Origin Transformation” group. This takes the point in your “Rhino Origin” (0,0,0) and “Working Minecraft Origin” ((X,Y,Z) whatever you set) makes a vector that then moves all your points from your rhino workspace coordinate system to wherever you Minecraft workspace is.
8. To the right of this these points currently feed into two different groups “Deleter” and “Add” . Both concatenate the point coordinates you feed it into specific Minecraft command window commands that will then populate your function. Here you can select material by typing into the “Material” panel the cap sensitive “data identifier” text of the Minecraft block you wish to instantiate (If you don’t know what that is see
Minecraft Wiki Blocks, select your block, and scroll down to find it’s data identifier)
9. The “Deleter” group is currently populated with “air” and essentially clears all those point locations. Keep this plugged into D1 of merge if you want to delete everything you previously created. And unplug everything else from Left side of Merge if you do not wish to construct new blocks.
10. The “Add” group is currently populated with “grass_block” and is the exact same function as the deleter so think of these as material override commands, one’s just used to “create” void space instead of building up new blocks.
11. You can copy and paste these “Add/Deleter” groups, rename them, etc. the key is to make sure you plase them vertically in the grasshopper space in the hierarchy you want them to be executed, and plug them the same way into the “merge” block in the lower left hand corner of the group to the right of these. This will ensure that the commands are not compiled out of order.
12. To the right, the “Block Max Warning” group is mostly a pass through, but if you exceed 100,000 block commands it will send an error message to the warning compiler. This is because I’ve noticed that greater than 100,000 commands in one function, or a hundred functions with a thousand commands each basically represent the cap of what Minecraft can presently handle in any single execution of code/command.
13. These merged commands pass into the “Per Function” group. Here you need to copy the address on your PC location and your folders, i.e. replace my world name with yours, replace “workflow”, “rhino”, and “function.all” in my address to what you did in the Datapacks Tutorial. This is a very detail oriented task. Also make sure that you copy all your datapacks content into the world you are currently working in. If you did the tutorial in another world, copy all you content to the world name you are working in now:
C:\Users\Your user\AppData\Roaming\.minecraft\saves\Your minecraft world name\datapacks\workflow\data\rhino\functions\all.mcfunction
Edit this path in File Explorer and copy/paste into File Path. Then hit “update” to replace the function in your path with your new string of commands.Once you have all this mapped out in rhino.
- Now we go back to our Minecraft world. Rember to /reload, and then /function insert your datapacks call (e.g for me it’s /function rhino:all )
Now you should have your geometry in Minecraft!