Skip to content

added npx create-mc-bedrock. #1031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: wiki
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/meta/useful-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mentions:
- JaylyDev
- zheaEvyline
- phoenixr-codes
- Keyyard
description: Useful links for developing add-ons.
---

Expand Down Expand Up @@ -129,6 +130,7 @@ These packs are published by the open-source community.
- [GameTests API Wrapper](https://github.com/notbeer/Framework-Wrapper)
- [GameTests Plugin-API-Starter-Pack](https://github.com/MajestikButter/Plugin-API-Starter-Pack)
- [Useful for Block Tags](https://mcpedl.com/debug-stick/)
- [create-mc-bedrock CLI](https://github.com/Keyyard/create-mc-bedrock-cli)

## Raytracing Resources

Expand Down
37 changes: 36 additions & 1 deletion docs/scripting/scripting-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mentions:
- SimpleDevMCBE
- QuazChick
- jeanmajid
- Keyyard
description: Learn how to modify your world through the use of JavaScript files.
---

Expand All @@ -28,7 +29,7 @@ The Script API (formerly GameTest Framework) is a feature that allows for a new

This page will give you an introduction to the 80% of Minecraft's Creator API concepts that you will use on a daily basis.

## Create Your First Project
## Create Your First Project Manually

Currently, scripts can only be used in behavior packs.

Expand Down Expand Up @@ -176,6 +177,34 @@ system.runInterval(() => {
}, 1);
```


## Using `create-mc-bedrock` to Set Up a Workspace Automatically
`create-mc-bedrock` is a simple interactive CLI tool to help you quickly set up Minecraft Bedrock projects by cloning samples from the [Microsoft Minecraft Scripting Samples](https://github.com/Microsoft/Minecraft-Scripting-Samples) repository.

This tool is recommended for experienced developers to quickly set up a project with a compiler. Generated templates usually come with a compiler and a build system, so you can start coding right away. Works with both JavaScript and TypeScript.

It requires Node.js and npm to be installed on your system.

#### Steps:

1. Open a terminal and run the following command:
```bash
npx create-mc-bedrock
```
2. Follow the prompts to select a template for your project.
3. Once the setup is complete, navigate into the generated folder:
```bash
cd <your-project-folder>
```
4. Install the dependencies:
```bash
npm install
```
5. Start working with the provided template workspace, which includes Microsoft's official setup for Bedrock scripting.
- ``npm run local-deploy``: This command will build the project and deploy into your local Minecraft. You should see your package in Minecraft now.
- ``npm run mcaddon``: This command will build the project into mcaddon files in the `dist` folder.
- you can discover more commands in the `package.json` file.

## Reference Documentation

Official documentation are hosted on Microsoft Learn and can be found here:
Expand Down Expand Up @@ -215,3 +244,9 @@ Latest stable API modules:
npm i @minecraft/server
npm i @minecraft/server-ui
```

Official Microsoft Minecraft Scripting Samples:
- [Minecraft Scripting Samples](https://github.com/Microsoft/Minecraft-Scripting-Samples)

Community-based CLI tools:
- [`create-mc-bedrock` CLI](https://github.com/Keyyard/create-mc-bedrock-cli).