Skip to content

Commit 95966d2

Browse files
authored
Creator Camp Samples (#88)
1 parent 342bb26 commit 95966d2

58 files changed

Lines changed: 8214 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

creator_camp/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PROJECT_NAME="creator_camp"
2+
MINECRAFT_PRODUCT="PreviewUWP"
3+
CUSTOM_DEPLOYMENT_PATH=""

creator_camp/.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": false,
6+
"bracketSpacing": true,
7+
"arrowParens": "always",
8+
"printWidth": 120,
9+
"endOfLine": "auto"
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"blockceptionltd.blockceptionvscodeminecraftbedrockdevelopmentextension",
5+
"mojang-studios.minecraft-debugger"
6+
]
7+
}

creator_camp/.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.3.0",
3+
"configurations": [
4+
{
5+
"type": "minecraft-js",
6+
"port": 19144,
7+
"mode": "listen",
8+
"name": "Debug with Minecraft",
9+
"preLaunchTask": "build",
10+
"sourceMapRoot": "${workspaceFolder}/dist/debug/",
11+
"generatedSourceRoot": "${workspaceFolder}/dist/scripts/"
12+
}
13+
]
14+
}

creator_camp/.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"[javascript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[typescript]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[typescriptreact]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[json]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"git.ignoreLimitWarning": true,
15+
"editor.formatOnSave": true,
16+
"search.exclude": {
17+
"**/.git": true,
18+
"**/node_modules": true,
19+
"**/dist": true,
20+
"**/lib": true
21+
},
22+
"files.exclude": {
23+
"**/.git": true,
24+
"**/.DS_Store": true,
25+
"**/node_modules": true
26+
},
27+
"cSpell.words": [
28+
"gametest",
29+
"gametests",
30+
"mcaddon"
31+
],
32+
"editor.tabSize": 2,
33+
"eslint.experimental.useFlatConfig": true
34+
}

creator_camp/.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"dependsOrder": "sequence",
7+
"dependsOn": [
8+
"minecraft: deploy"
9+
]
10+
}
11+
]
12+
}

creator_camp/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
page_type: sample
3+
author: mammerla
4+
description: A basic progressive example of using custom block features within Minecraft.
5+
ms.author: mikeam@microsoft.com
6+
ms.date: 01/31/2024
7+
products:
8+
- minecraft
9+
---
10+
11+
# Minecraft Creator Camp Sample Project
12+
13+
This sample demonstrates custom entities, blocks, and worldgen features demonstrated as part of [Creator Camp](https://aka.ms/creatorcamp).
14+
15+
- Custom Entity: Camp Ghost
16+
- Custom Block: Pile of Leaves
17+
- Custom Item: Leaf Bag
18+
- Jigsaw Structures: Tent/Camp Area
19+
- Features: Tall Camp Trees
20+
21+
## Important!
22+
23+
Because this targets beta versions of Minecraft Scripting APIs (2.0.0), you should use
24+
25+
```powershell
26+
npm i --legacy-peer-deps
27+
```
28+
29+
to install dependencies.
30+
31+
This project will also deploy against the Preview version of Minecraft.
32+
33+
## Prerequisites
34+
35+
**Install Node.js tools, if you haven't already**
36+
37+
We're going to use the package manager [npm](https://www.npmjs.com/package/npm) to get more tools to make the process of building our project easier.
38+
39+
Visit [https://nodejs.org/](https://nodejs.org).
40+
41+
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.
42+
43+
**Install Visual Studio Code, if you haven't already**
44+
45+
Visit the [Visual Studio Code website](https://code.visualstudio.com) and install Visual Studio Code.
46+
47+
## Getting Started
48+
49+
1. 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**.
50+
51+
1. Put the extracted contents of the custom_blocks folder into **custom_blocks**.
52+
53+
1. Open a Windows Terminal or PowerShell window and change the working directory to your **custom_blocks** folder:
54+
55+
```powershell
56+
cd c:\projects\custom_blocks\
57+
```
58+
59+
1. Use npm to install our tools:
60+
61+
```powershell
62+
npm i --legacy-peer-deps
63+
```
64+
65+
1. When that's done, enter:
66+
67+
```powershell
68+
npm run local-deploy
69+
```
70+
71+
1. Use this shortcut command to open the project in Visual Studio Code:
72+
73+
```powershell
74+
code .
75+
```
76+
77+
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.
78+
79+
### Summary
80+
81+
This sample demonstrates various things you can build together that can be used to create fun camping experiences. See the [Minecraft Creator Channel](https://aka.ms/creatorcamp) for all the fun camping videos that accompany this demo.
82+
83+
## Manifest
84+
85+
- [behavior_packs/creator_camp](https://github.com/microsoft/minecraft-samples/blob/main/creator_camp/behavior_packs/creator_camp): This contains behavior implementations for a set of creator_camp items.
86+
- [resource_packs/creator_camp](https://github.com/microsoft/minecraft-samples/blob/main/creator_camp/resource_packs/creator_camp): This contains resources for a set of creator_camp items.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"format_version": "1.21.90",
3+
"minecraft:block": {
4+
"description": {
5+
"identifier": "creatorcamp:leaf_pile",
6+
"menu_category": {
7+
"category": "nature",
8+
"group": "minecraft:itemGroup.name.grass"
9+
},
10+
"states": {
11+
"creatorcamp:height": { "values": { "min": 0, "max": 2 } }
12+
}
13+
},
14+
15+
"components": {
16+
"minecraft:collision_box": {
17+
"origin": [-8, 2, -8],
18+
"size": [16, 4, 16]
19+
},
20+
"minecraft:selection_box": true,
21+
"minecraft:destructible_by_mining": {
22+
"seconds_to_destroy": 1
23+
},
24+
"minecraft:destructible_by_explosion": {
25+
"explosion_resistance": 0.5
26+
},
27+
"minecraft:flammable": {
28+
"destroy_chance_modifier": 100,
29+
"catch_chance_modifier": 100
30+
},
31+
"minecraft:geometry": "geometry.leaf_pile",
32+
"minecraft:material_instances": {
33+
"*": {
34+
"texture": "leaf_pile",
35+
"render_method": "alpha_test",
36+
"tint_method": "default_foliage"
37+
}
38+
},
39+
"minecraft:map_color": "#ffffff",
40+
"minecraft:liquid_detection": {
41+
"detection_rules": [
42+
{
43+
"liquid_type": "water",
44+
"on_liquid_touches": "popped"
45+
}
46+
]
47+
},
48+
"creatorcamp:stomped": {},
49+
"creatorcamp:grow": {}
50+
},
51+
"permutations": [
52+
{
53+
"condition": "query.block_state('creatorcamp:height') == 0",
54+
"components": {
55+
"minecraft:geometry": {
56+
"identifier": "geometry.leaf_pile",
57+
"bone_visibility": {
58+
"top": false,
59+
"middle": false
60+
}
61+
}
62+
}
63+
},
64+
{
65+
"condition": "query.block_state('creatorcamp:height') == 1",
66+
"components": {
67+
"minecraft:geometry": {
68+
"identifier": "geometry.leaf_pile",
69+
"bone_visibility": {
70+
"top": false,
71+
"middle": true
72+
}
73+
}
74+
}
75+
},
76+
{
77+
"condition": "query.block_state('creatorcamp:height') == 2",
78+
"components": {
79+
"minecraft:geometry": {
80+
"identifier": "geometry.leaf_pile",
81+
"bone_visibility": {
82+
"top": true,
83+
"middle": true
84+
}
85+
}
86+
}
87+
}
88+
]
89+
}
90+
}

0 commit comments

Comments
 (0)