-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an add_entity robot sample; update docs.
- Loading branch information
Showing
29 changed files
with
596 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,7 @@ | ||
# TODO: The maintainer of this repo has not yet edited this file | ||
|
||
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? | ||
|
||
- **No CSS support:** Fill out this template with information about how to file issues and get help. | ||
- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). | ||
- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. | ||
|
||
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* | ||
|
||
# Support | ||
|
||
## How to file issues and get help | ||
|
||
This project uses GitHub Issues to track bugs and feature requests. Please search the existing | ||
issues before filing new issues to avoid duplicates. For new issues, file your bug or | ||
feature request as a new Issue. | ||
|
||
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE | ||
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER | ||
CHANNEL. WHERE WILL YOU HELP PEOPLE?**. | ||
|
||
## Microsoft Support Policy | ||
|
||
Support for this **PROJECT or PRODUCT** is limited to the resources listed above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
page_type: sample | ||
author: mammerla | ||
description: A basic Hello World example of adding a new entity in for Minecraft. | ||
ms.author: [email protected] | ||
ms.date: 03/01/2022 | ||
languages: | ||
- json | ||
- python | ||
products: | ||
- minecraft | ||
--- | ||
|
||
# Adding a new entity into Minecraft | ||
|
||
This sample demonstrates how to add a new entity into Minecraft. | ||
|
||
See [this article on the Minecraft Creator Portal](https://docs.microsoft.com/minecraft/creator/documents/introductiontoaddentity) for the full walkthrough of how to build this demo. | ||
|
||
## Running the sample within Minecraft | ||
|
||
Run the following batch file to copy these files into your Minecraft: Bedrock Edition folder. | ||
|
||
```powershell | ||
install_uwp.cmd | ||
``` | ||
|
||
To use the new entities, follow these instructions inside of Minecraft. | ||
|
||
1. From Play, select Create New | ||
1. Select Create New World | ||
1. Give your world a title | ||
1. Under Default Game Mode, select Creative | ||
1. Under Resource Packs, and under My Packs, select either Robot Minimal or Robot Full examples. | ||
|
||
|
||
|
||
## Manifest | ||
|
||
- [min](https://github.com/microsoft/minecraft-samples/blob/main/add_entity_robot/min/): Minimal starter version of this sample - useful for the start of [the corresponding article](https://docs.microsoft.com/minecraft/creator/documents/introductiontoaddentity) | ||
- [full](https://github.com/microsoft/minecraft-samples/blob/main/add_entity_robot/full/): Full, completed version of this sample - this should match your project at the end of [the corresponding article](https://docs.microsoft.com/minecraft/creator/documents/introductiontoaddentity) | ||
- [install_uwp.cmd](https://github.com/microsoft/minecraft-samples/blob/main/add_entity_robot/install_uwp.cmd): Copies these projects into your Minecraft: Bedrock Edition UWP projects folder (`%localappdata%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang\`) |
26 changes: 26 additions & 0 deletions
26
...t/full/robot_example_full_behavior/animation_controllers/robot.animation_controllers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"format_version": "1.10.0", | ||
"animation_controllers": { | ||
"controller.animation.robot.in_water": { | ||
"states": { | ||
"default": { | ||
"transitions": [ | ||
{"in_water": "query.is_in_water_or_rain"} | ||
] | ||
}, | ||
"in_water": { | ||
"animations": [ | ||
"poison" | ||
], | ||
"on_exit": [ | ||
"/effect @s regeneration 2 4 true", | ||
"/playsound random.fizz @a[r=16]" | ||
], | ||
"transitions": [ | ||
{"default": "query.is_in_water_or_rain == 0"} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
add_entity_robot/full/robot_example_full_behavior/animations/robot.animation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"format_version": "1.8.0", | ||
"animations": { | ||
"animation.robot.poison": { | ||
"loop": true, | ||
"animation_length": 1, | ||
"timeline": { | ||
"0.0": [ | ||
"/effect @s poison 2 0 true" | ||
] | ||
} | ||
} | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
add_entity_robot/full/robot_example_full_behavior/entities/robot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"format_version": "1.12.0", | ||
"minecraft:entity": { | ||
"description": { | ||
"identifier": "compass:robot", | ||
"is_spawnable": true, | ||
"is_summonable": true, | ||
"animations": { | ||
"poison": "animation.robot.poison", | ||
"in_water": "controller.animation.robot.in_water" | ||
}, | ||
"scripts": { | ||
"animate": [ | ||
"in_water" | ||
] | ||
} | ||
}, | ||
"components": { | ||
"minecraft:physics": {}, | ||
"minecraft:nameable": {}, | ||
"minecraft:movement": { | ||
"value": 0.25 | ||
}, | ||
"minecraft:movement.basic": {}, | ||
"minecraft:jump.static": {}, | ||
"minecraft:navigation.walk": { | ||
"avoid_water": true | ||
}, | ||
"minecraft:behavior.tempt": { | ||
"priority": 1, | ||
"speed_multiplier": 1.4, | ||
"items": ["diamond"], | ||
"within_radius": 7.0 | ||
}, | ||
"minecraft:behavior.random_stroll": { | ||
"priority": 3, | ||
"speed_multiplier": 0.8 | ||
}, | ||
"minecraft:experience_reward": { | ||
"on_death": 8 | ||
} | ||
}, | ||
"component_groups": { | ||
"compass:color_0": { | ||
"minecraft:variant": {"value": 0} | ||
}, | ||
"compass:color_1": { | ||
"minecraft:variant": {"value": 1} | ||
}, | ||
"compass:color_2": { | ||
"minecraft:variant": {"value": 2} | ||
} | ||
}, | ||
"events": { | ||
"minecraft:entity_spawned": { | ||
"randomize": [ | ||
{ | ||
"add": { | ||
"component_groups": ["compass:color_0"] | ||
} | ||
}, { | ||
"add": { | ||
"component_groups": ["compass:color_1"] | ||
} | ||
}, { | ||
"add": { | ||
"component_groups": ["compass:color_2"] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
add_entity_robot/full/robot_example_full_behavior/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"format_version": 1, | ||
"header": { | ||
"name": "Robot Add-Entity Full Example - Behavior", | ||
"description": "", | ||
"uuid": "6eaedf14-74c0-49e1-907d-3a8974cb006b", | ||
"min_engine_version": [1, 12, 0], | ||
"version": [0, 0, 2] | ||
}, | ||
"modules": [ | ||
{ | ||
"description": "", | ||
"type": "data", | ||
"uuid": "ac0dbc5d-6267-4bcc-ac65-521e5054c31b", | ||
"version": [0, 0, 2] | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
add_entity_robot/full/robot_example_full_behavior/spawn_rules/robot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"format_version": "1.8.0", | ||
"minecraft:spawn_rules": { | ||
"description": { | ||
"identifier": "compass:robot", | ||
"population_control": "animal" | ||
}, | ||
"conditions": [ | ||
{ | ||
"minecraft:spawns_on_surface": {}, | ||
"minecraft:brightness_filter": { | ||
"min": 12, | ||
"max": 15, | ||
"adjust_for_weather": false | ||
}, | ||
"minecraft:weight": { | ||
"default": 40 | ||
}, | ||
"minecraft:biome_filter": { | ||
"test": "has_biome_tag", | ||
"value": "animal" | ||
} | ||
} | ||
] | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
add_entity_robot/full/robot_example_full_resources/animations/robot.animation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"format_version": "1.8.0", | ||
"animations": { | ||
"animation.robot.drive": { | ||
"loop": true, | ||
"bones": { | ||
"wheel": { | ||
"rotation": ["query.modified_distance_moved*40", 0, 0] | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
add_entity_robot/full/robot_example_full_resources/entity/robot.entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"format_version": "1.10.0", | ||
"minecraft:client_entity": { | ||
"description": { | ||
"identifier": "compass:robot", | ||
"spawn_egg": { | ||
"base_color": "#505152", | ||
"overlay_color": "#3b9dff" | ||
}, | ||
"render_controllers": [ | ||
"controller.render.robot" | ||
], | ||
"geometry": { | ||
"default": "geometry.robot" | ||
}, | ||
"textures": { | ||
"default": "textures/entity/robot", | ||
"variant_b": "textures/entity/robot_b", | ||
"variant_c": "textures/entity/robot_c" | ||
}, | ||
"materials": { | ||
"default": "entity" | ||
}, | ||
"animations": { | ||
"drive": "animation.robot.drive" | ||
}, | ||
"scripts": { | ||
"animate": ["drive"] | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
add_entity_robot/full/robot_example_full_resources/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"format_version": 1, | ||
"header": { | ||
"name": "Robot Add-Entity Full Example - Resources", | ||
"description": "", | ||
"uuid": "bb405256-d96b-44c4-aca5-5044b660a0b2", | ||
"min_engine_version": [1, 12, 0], | ||
"version": [0, 0, 2] | ||
}, | ||
"modules": [ | ||
{ | ||
"description": "", | ||
"type": "resources", | ||
"uuid": "2501c3e0-b136-41eb-85fc-c4457e8dfc7b", | ||
"version": [0, 0, 2] | ||
} | ||
] | ||
} |
Oops, something went wrong.