page_type | author | description | ms.author | ms.date | products | |
---|---|---|---|---|---|---|
sample |
mammerla |
A basic progressive example of using custom block features within Minecraft. |
01/31/2024 |
|
This sample demonstrates a simple build process and TypeScript compilation for Minecraft. This readme shows how you can use Betas APIs experiment to build out simple gameplay styles. You can use this project as a starter for your own scripting projects.
Install Node.js tools, if you haven't already
We're going to use the package manager npm to get more tools to make the process of building our project easier.
Visit https://nodejs.org/.
Download the version with "LTS" next to the number and install it. (LTS stands for Long Term Support, if you're curious.) In the Node.js Windows installer, accept the installation defaults. You do not need to install any additional tools for Native compilation.
Install Visual Studio Code, if you haven't already
Visit the Visual Studio Code website and install Visual Studio Code.
-
To make your own environment look like the example, create a folder on your
C:\
drive and call it projects. Create a subfolder called custom_blocks. -
Put the extracted contents of the custom_blocks folder into custom_blocks.
-
Open a Windows Terminal or PowerShell window and change the working directory to your custom_blocks folder:
cd c:\projects\culled blocks\
-
Use npm to install our tools:
npm i
-
When that's done, enter:
npm i gulp-cli --global
-
Use this shortcut command to open the project in Visual Studio Code:
code .
It might also ask you to install the Minecraft Debugger and Blockception's Visual Studio Code plugin, which are plugins to Visual Studio Code that can help with Minecraft development. Go ahead and do that, if you haven't already.
This sample demonstrates how you can build incrementally more sophisticated blocks, and how you can leverage custom block features and components.
- behavior_packs/custom_blocks: This contains behavior implementations for a set of custom blocks.
- resource_packs/custom_blocks: This contains resources for a set of custom blocks.