Skip to content

Commit

Permalink
Add an add_entity robot sample; update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mammerla committed Mar 2, 2022
1 parent 31d08d3 commit 4f1c405
Show file tree
Hide file tree
Showing 29 changed files with 596 additions and 25 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Project

> This repo has been populated by an initial template to help get you started. Please
> make sure to update the content to build a great experience for community-building.
This project contains samples that further extend the [Minecraft: Bedrock Edition Creator Documentation](https://docs.microsoft.com/minecraft/creator/)

As the maintainer of this project, please make a few updates:
## Current Samples

- Improving this README.MD file to provide a great experience
- Updating SUPPORT.MD with content about this project's support experience
- Understanding the security reporting process in SECURITY.MD
- Remove this section from the README
* [Add Entity Robot](add_entity_robot/README.md) - A simple project that demonstrates how to create a new entity, that accompanies [this article](https://docs.microsoft.com/minecraft/creator/documents/introductiontoaddentity).

## Contributing

Expand Down
18 changes: 0 additions & 18 deletions SUPPORT.md
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.
42 changes: 42 additions & 0 deletions add_entity_robot/README.md
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\`)
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"}
]
}
}
}
}
}
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"
]
}
}
}
}
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 add_entity_robot/full/robot_example_full_behavior/manifest.json
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.
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"
}
}
]
}
}
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]
}
}
}
}
}
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 add_entity_robot/full/robot_example_full_resources/manifest.json
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]
}
]
}
Loading

0 comments on commit 4f1c405

Please sign in to comment.