Respawn Commands

recipe

Learn more about Animation Controllers

This animation controller can be used to run commands, such as re-adding potion effects or giving items when the player respawns.

Simply add the animation controller to the player.json, and

BP/animation_controllers/respawn.ac.jsonCopy
json
{
	"format_version": "1.10.0",
	"animation_controllers": {
		"controller.animation.death": {
			"initial_state": "initialization",
			"states": {
				"initialization": {
					"transitions": [
						{
							"has_died": "!query.is_alive"
						}
					],
					"on_exit": [
						"variable.delay = 0.2 + query.life_time;",
						"/<death command or animation>"
					]
				},
				"has_died": {
					"on_exit": ["/<Respawn command or animation>"],
					"transitions": [
						{
							"initialization": "query.is_alive && (query.life_time >= variable.delay)"
						}
					]
				}
			}
		}
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

Contributors

cda94581MedicalJewel105SmokeyStackBlueFrog130SirLich