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 following animation controller to the player.json, and you'll be all done!

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": "!q.is_alive"
						}
					],
					"on_exit": [
						"v.delay = 0.2 + q.life_time;",
						"/<death command or animation>"
					]
				},
				"has_died": {
					"on_exit": ["/<Respawn command or animation>"],
					"transitions": [
						{
							"initialization": "q.is_alive && (q.life_time >= v.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

SirLichMedicalJewel105