Skip to content

Commit

Permalink
[Docs] Added entity interact docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marten-Mrfc committed Jul 30, 2024
1 parent 279f0e2 commit 9fe9bca
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
difficulty: Easy
---

import EntrySearch from "@site/src/components/EntrySearch";
import Image from "@site/src/components/Image";

# Interacting with an entity
:::info[Before starting]
It's best to first read [Entities & NPC's](./index.mdx) before starting this tutorial.
:::

In this tutorial, you will learn how to interact with an entity.

## Adding the entity interact event
First, we need to add the `Add On Entity Interact Event` entry to our sequence. This can be done by clicking on the + icon in the top right corner of the panel and searching for `Add On Entity Interact Event`. Add it to your page by clicking on the + icon.

<EntrySearch entryName="entity_interact_event"/>

### Selecting the definition
Now inside the inspector of the `New Entity Interact Event` at the definition field, select the definition of the entity you want to interact with. (For this tutorial that will be Oliver)

<Image img={require("../../assets/entity-adapter/entity-interact-event-fields.png")} alt="Entity Interact Event Fields" width={400} />

## Adding the event.
Now we need to add an event that gets triggered when the player interacts with the entity (For this tutorial we will use a spoken). Right-click on the `New Entity Interact Event` entry and click on `+ link with ...` to open the search menu. Search for `Add Spoken` and add it to the page.

<EntrySearch entryName="spoken"/>

Set the speaker to the oliver definition and text field to `Hello I am Oliver.`.

## Result
You can now publish your pages, and in-game, it should look like this when interacting with Oliver:

:::warning[Mc-Auth servers]
So while writing this page the auth servers of minecraft are down and i couldn't access my tw server. So i can't provide a video of the result as of right now.(This will hopefully be fixed soon)
:::
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9fe9bca

Please sign in to comment.