# Section 5: Advanced functions and JSON

How does an emote.json look like?

```
{
	"name": "Name",
	"author": "Author",
	"description": "this is an example emote",
	"you can add": "comment like this",
	"emote":{
	...
}
```

In the file you have the base info like name, description...\
you can add comments to the file unlike the most JSON file, the mod will warn for every unknown block except "comment" but won't fail

```
"emote":{
    "isLoop": "false",
    "returnTick": 2,
		"beginTick":12,
		"endTick":70,
		"stopTick":75,
		"degrees":true,
		"moves":[
		...
		]
	}
```

In the emote block there is the basic info, like the length\
the `endTick` and the `stopTick` mean the time where the player will reset their pose smooth.\
the begin tick is the same from tick 0.

You can loop the emote, with turning the `isLoop` true and set the returnTick. It will return from the `endTick` to `returnTick`.\
`returnTick` have to be smaller than `endTick`

`degrees`: the rotation values are in degrees or radian

```
			{
				"tick":12,
				"turn": 0,
				"easing": "InOutSine",
				"head":{
					"yaw":-96
				}
			},
```

the keyframe. `turn` generates a new keyframe after this in the same tick, with rotated `turn` amount of full turns. The same solution can be produced with Constant easing

the `tick` show the keyframe's location in MC time (20 ticks = 1 second)

The `easing` is the easing method after this frame.\
Easings are from <https://easings.net/#> + `linear` + `constant`\
you can use capital letters, you can write with ease or without. Both are correct :

```
easeinoutsine
InoUtSInE
```

parts: head, torso, leftLeg, rightLeg, leftArm, rightArm.

value types: x, y, z, pitch, yaw, roll, bend, axis

To bend something, add a bend value. \
The head does not support bending...

{% hint style="warning" %}
The head, legs and arms location is relative to the torso's  location and rotation
{% endhint %}

```
{
	"name": "Name",
	"author": "Author",
	"description": "this is an example emote",
	"you can add": "comment like this",
	"emote":{
		"beginTick":12,
		"endTick":70,
		"stopTick":75,
		"degrees":true,
		"moves":[
			{
				"tick":12,
				"easing": "InOutSine",
				"head":{
					"yaw":-96
				}
			},
			{
				"tick": 45,
				"easing": "linear",
				"turn": -10,
				"comment": "after tick 45 the right arm's yaw will set back with a full turn",
				"head": {
					"yaw": 3663,
					"comment": "you cannot define a value for the same tick twice (in this case pitch)"
				}
			}
		]
	}
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kosmx.gitbook.io/emotecraft/tutorial/section-5-advanced-functions-and-json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
