Bedrock Wiki
  • Discord
  • Contribute
  • bedrock.dev
  • MS Learn
Beginner's Guide
  • Guide
    • 1. Introduction
      guide
    • 2. Add-Ons Explained
    • 3. Software & Preparation
    • 4. Project Setup
    • 5. Create a Custom Item
    • 6. Create a Custom Entity
    • 7. Blockbench: Modeling, Texturing & Animating
    • 8. Adding a Loot Table, Spawn Rule & Crafting Recipe
  • Extra
    • a. Understanding JSON
    • b. Download Example Packs
    • c. Troubleshooting
      help
    • d. Advanced Manifest
    • e. Format Versions
    • f. Project Setup Android
Animation Controllers
  • Intro to Animation Controllers
    guide
  • Entity Commands
  • AFK Detector
  • Death Commands
  • Molang into Scoreboard
  • Respawn Commands
Blocks
  • General
    • Intro to Blocks
      guide
    • Block Components
    • Block Tags
    • Block States
    • Block Traits
    • Block Permutations
    • Block Events
      Scripts
    • Block Event Migration
      help
    • Blocks as Items
    • Troubleshooting Blocks
      help
  • Visuals
    • Block Culling
    • Block Models
      guide
    • Block Texture Animation
    • Block Texture Variation
    • Block Tinting
  • Tutorials
    • Applying Constant Effects
      Scripts
    • Avoiding State Limit
    • Fake Blocks
    • Ore Loot Tables
      Scripts
    • Precise Interaction
      Scripts
    • Precise Rotation
      Scripts
    • Rotatable Blocks
  • Vanilla Re-Creations
    • Custom Crops
      Scripts
    • Custom Glass
    • Custom Glazed Terracotta
    • Custom Trapdoors
      Scripts
  • Documentation
    • Block Format History
    • Block Shapes
    • Block Sounds
    • Vanilla Block Models
Commands
  • General
    • Intro to Command Blocks
    • Functions
    • Block States
    • Coordinate System
    • NBT Commands
    • Scoreboard Operations
    • Understanding Selectors
  • Commands
    • Damage
    • Execute
    • Playanimation
    • Playsound
  • On Event Systems
    • On Player First Join
    • On Player Join
    • On Player Leave
    • On Player Death
    • On Player Respawn
    • On First World Load
  • Scoreboard Systems
    • Entity Counter
    • Scoreboard Timers
    • Comparing And Retrieving Scores
  • Techniques
    • Execute Logic Gates
    • MBE - Max's Block Entity
    • FMBE - A New Way to Create Display Entities
    • Look Detection
    • Movement Detections
    • Orbital Camera
  • Useful Creations
    • Custom Crafter
    • Multiplayer Position Rearrangement
      function
Concepts
  • contents.json
  • Emojis & Symbols
  • Molang
  • Namespaces
  • Overwriting Assets
  • Raw Text
  • Shaders
  • Sounds
  • Subpacks
  • Text and Localization
  • Texture Atlases
  • textures_list.json
Documentation
  • Shared Constructs
  • Advanced Molang
  • File Types
  • Fog IDs
  • Material Configuration Description
  • Menu Categories
  • Molang Queries
  • Pack Folder Structure
  • Sound Definitions
  • Vanilla Materials
Entities
  • General
    • Intro to Entities BP
      guide
    • Intro to Entities RP
      guide
    • Troubleshooting Entities
      help
    • Entity Events
    • Entity Properties
    • NPC Dialogues
    • Render Controllers
    • Spawn Rules
  • Tutorials
    • Convert Points Between Any Space (World, Entity, Bones)
    • Creating Boats
    • Detecting Other Entities
    • Disabling Team Damage
    • Dummy Entities
    • Entity Attacks
    • Entity Holds Item
    • Entity Movement
    • Entity Timers
    • Flying Entities
    • Introduction to AOE Clouds
    • Invulnerable Entities
    • Look at Entity
    • Sleeping Entities
    • Solid Entities
    • Spawning Tamed Entities
      Scripts
    • Village Mechanic
  • Documentation
    • Dummy Components
    • Non-Mob Runtime Identifiers
    • Projectiles
    • Runtime Identifiers
    • Vanilla Usage Components
    • Vanilla Usage Spawn Rules
Items
  • General
    • Intro to Items
      guide
    • Item Components
    • Item Tags
    • Item Events
      Scripts
    • Item Event Migration
      help
    • Troubleshooting Items
      help
  • Tutorials
    • Custom Armor
    • Custom Food
      Scripts
    • Custom Pottery Sherds
    • Custom Weapons
    • Equipment-Based Commands
    • High Resolution Items
    • Spawning Items
    • Throwable Items
  • Documentation
    • Enchantments
    • Attachables
    • Item Format History
    • Numerical Item IDs
    • Vanilla Item Identifiers
    • Vanilla Usage Components
JSON UI
  • General
    • Intro to JSON UI
      guide
    • Best Practices
      guide
  • Tutorials
    • Adding HUD Elements
    • Aseprite Animations
    • Buttons and Toggles
    • Modifying Server Forms
    • Preserve Title Texts
    • String to Number
  • Documentation
    • JSON UI Documentation
Loot, Recipes & Trading
  • General
    • Trading Behavior
  • Documentation
    • Loot Tables
    • Trade Tables
    • Recipes
    • Item Functions
  • Tutorials
    • Randomized Structure Loot
Meta
  • Add-On Performance
  • Style Guide
  • Useful Links
  • Using Schemas
  • Version Control
  • Q&A
    • Blocks and Items Q&A 2024/08/30
    • Deferred Technical Preview Q&A 2024/02/23
    • GameTest Q&A 2021/08/06
    • Scripting and Editor Q&A 2023/09/22
    • World Generation Q&A 2024/11/15
NBT
  • General
    • .mcstructure
  • Tutorials
    • Experiments in Education Edition
    • Extending Structure Limits
  • NBT in Depth
    • About NBT (Named Binary Tag)
    • NBT Libraries
    • Reading NBT Example
Particles
  • General
    • Intro to Particles
      guide
  • Tutorials
    • Disabling Particles
  • Documentation
    • Vanilla Particles
Scripting
  • General
    • Intro to Scripting
    • What is Script API?
    • API Modules
  • Tutorials
    • Block Placement Prevention
    • GameTests
    • Script Core Features
    • Script Forms
    • Script Requests API
    • Simple Chat Commands
  • Documentation
    • Engine Environment
    • Script Resources
    • Script Watchdog
    • Troubleshooting JavaScript
    • TypeScript
Servers
  • Software
    • Bedrock Server Software
  • Protocols
    • Bedrock Protocol
    • NetherNet Protocol
    • RakNet Protocol
Visuals
  • General
    • Introduction to Entity Visuals
      guide
    • Bedrock Modeling
    • Custom Death Animations
    • Effects in Animations
    • Material Creations
    • Materials
    • Math-Based Animations
    • Skin Packs
  • Tutorials
    • Entity Texture Animation
    • Glowing Entity Texture
    • Hurt Animations
    • Leash Position
    • Player Geometry
    • Remove Entity Shadows
    • Retexturing Spawn Eggs
  • Ideas
    • Structure Presentation
World Generation
  • General
    • Intro to World Generation
      guide
    • Biomes
      guide
    • Feature Types
    • Jigsaw Structures
  • Tutorials
    • Block Conditions for Features
    • Generating Custom Ores
    • Generating Custom Structures
    • Generating Patches
    • Heightmap Noise
  • Documentation
    • Biome Tags

Custom Death Animations

intermediate
Custom Death Animations
  • Cancelling Death Animations
    • Teleporting the Entity
    • minecraft:instant_despawn
    • Transformation to another entity
    • Cancelling the Animation
  • Custom Death Animations
    • Changing Damage Color Overlay
    • Using Damage Sensor to Trigger Instant Despawn and One Item Drop
    • Detecting Death with Commands

Death animation refers to the rotation of the entity as it dies. This is accompanied by a red coloring and followed shortly after by the disappearance of the entity geometry and the appearance of the death particles.

Cancelling Death Animations ​

This part will explain how to remove death animations at all.

Teleporting the Entity ​

A fairly common way to remove entities without causing death effects is to teleport them into the void. This can be done from animation controllers by using !q.is_alive like: /teleport @s ~ ~-1000 ~

Please note that this will remove all death effects, including sound, particles, loot, and the visual death of the entity.

minecraft:instant_despawn ​

If you want to make entity just disappear, you can add component group with "minecraft:instant_despawn":{} and run an event which will add this component group.

Please note that this will remove all death effects, including sound, particles, loot, and the visual death of the entity.

Transformation to another entity ​

Similar to teleporting, the entity is triggering an entity transform on death. Use !q.is_alive in animation controller to send an event which will add component group with "minecraft:transformation" component. With this component entity will convert into another:

json
"minecraft:transformation": {
	"into": "wiki:death_animation_entity",
	"transformation_sound" : "converted_to_zombified",
	"keep_level": true,
	"drop_inventory": true,
	"preserve_equipment": false,
	"drop_equipment": true,
	"delay": {
		"block_assist_chance": 0.0,
		"block_radius": 0,
		"block_max": 0,
		"value": 10
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Cancelling the Animation ​

We can also cancel the rotational value of the entity, allowing the entity to die more conventionally (particles, red-coloring, loot) without the 90-degree spin.

If you need more information about triggering animations from entity death, see this document on death effects.

Rotation needs to be applied to a bone parent to all other bones, with a pivot at [0,0,0], and the animation should only start when !q.is_alive.

Animation:

json
"rotation" : [ 0, 0, "Math.min(Math.sqrt(Math.max(0, q.anim_time * 20 - 0.5) / 20 * 1.6), 1) * -90" ]
1

Animation Controller:

(q.all_animations_finished is only needed for respawning entities, like players)

RP/animation_controllers/custom_death.animation.controllers.json
json
{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.player.cancel_death_animaton": {
            "initial_state": "default",
            "states": {
                "default": {
                    "transitions": [
                        {
                            "cancel_animation": "!q.is_alive"
                        }
                    ]
                },
                "cancel_animation": {
                    "animations": ["my.animation"],
                    "transitions": [
                        {
                            "default": "q.is_alive && q.all_animations_finished"
                        }
                    ]
                }
            }
        }
    }
}
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

Note that you will need attach animation and animations controller in .entity.json file of resource pack.

Custom Death Animations ​

This part will explain how to customize death animation.

Changing Damage Color Overlay ​

You can remove/customize entity damage color overlay.

Before starting, you must have the basics of render controller so check out the tutorial of render controllers.

To remove the damage overlay color of any entity you want when it gets damaged, we will use is_hurt_color and remove the damage overlay color when an entity receives damage from lava or fire use on_fire_color. First, you need to make the rgba values to 0 Here's the example of removing the damage and fire overlay color.

RP/render_controllers/custom_death.render_controllers.json
json
{
    "format_version": "1.8.0",
    "render_controllers": {
        "controller.render.sample": {
            "geometry": "Geometry.default",
            "materials": [{ "*": "Material.default" }],
            "textures": ["Texture.default"],
            "is_hurt_color": {},
            "on_fire_color": {}
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12

The code above will remove the red damage overlay color.

You can also change the damage color overlay to different colors just by putting different values in rgba. You can check out various websites to get the rgba values of all colors. Here's another example in which the damage color overlay becomes pink.

RP/render_controllers/custom_death.render_controllers.json
json
{
    "format_version": "1.8.0",
    "render_controllers": {
        "controller.render.kbg": {
            "geometry": "Geometry.default",
            "materials": [{ "*": "Material.default" }],
            "textures": ["Texture.default"],
            "is_hurt_color": {
                "r": "1.0",
                "g": "0.4",
                "b": "0.7",
                "a": "0.5"
            },
            "on_fire_color": {
                "r": "1.0",
                "g": "0.4",
                "b": "0.7",
                "a": "0.5"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Using Damage Sensor to Trigger Instant Despawn and One Item Drop ​

You can use the damage_sensor component to trigger an event upon fatal damage; this event adds a particular despawning component group containing the spawn_entity and instant_despawn components. Spawn_entity with 0 wait time will drop an item just before the entity is despawned. For simple entities like furniture, which only need one item, this is very convenient.

When an entity recieves fatal damage, an event is triggered that adds a dummy component. We can then use this dummy component to play the animation and using minecraft:timer we can have it despawn.

Please note that you will have to find another work for entities with an inventory. You should also ensure that the despawn component group is not added when the entity is spawned using the entity_spawned event. If you have a entity that performs other actions (movement and attacks) you will likely want to remove those components as well.

Here an example file in the BP

BP/entities/entity.json
json
{
    "format_version": "1.14.0",
    "min_engine_version": "1.16.100",
    "minecraft:entity": {
        "description": {
            "identifier": "wiki:entity",
            "is_spawnable": true,
            "is_summonable": true,
            "is_experimental": true
        },
        "component_groups": {
            "wiki:death": {
                "minecraft:spawn_entity": {
                    "max_wait_time": 0,
                    "min_wait_time": 0,
                    "spawn_item": "egg",
                    "single_use": true
                },
                "minecraft:is_sheared": {},
                "minecraft:timer": {
                    "looping": true,
                    "time": [2.56, 2.56], // Change this to match your animation's time
                    "time_down_event": {
                        "event": "wiki:despawn"
                    }
                }
            },
            "wiki:despawn": {
                "minecraft:instant_despawn": {}
            }
        },
        "components": {
            "minecraft:type_family": {
                "family": ["cart", "inanimate"]
            },
            "minecraft:collision_box": {
                "width": 0.8,
                "height": 0.5
            },
            "minecraft:health": {
                "value": 8,
                "max": 8
            },
            "minecraft:physics": {},
            "minecraft:pushable": {
                "is_pushable": true,
                "is_pushable_by_piston": true
            },
            "minecraft:damage_sensor": {
                "triggers": {
                    "on_damage": {
                        "filters": {
                            "all_of": [
                                {
                                    "test": "has_damage",
                                    "value": "fatal"
                                }
                            ]
                        },
                        "target": "self",
                        "event": "wiki:death",
                        "deals_damage": false,
                        "cause": "fatal"
                    }
                }
            }
        },
        "events": {
            "wiki:death": {
                "add": {
                    "component_groups": ["wiki:death"]
                },
                "wiki:despawn": {
                    "add": {
                        "component_groups": ["wiki:despawn"]
                    }
                }
            }
        }
    }
}
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

Here an example file for the animation controller.

RP/animation_controllers/animation_controller.entity.json
json
{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.entity": {
            "states": {
                "default": {
                    "blend_transition": 0.2,
                    "transitions": [
                        {
                            "dead": "q.is_sheared"
                        }
                    ]
                },
                "death": {
                    "blend_transition": 0.2,
                    "animations": ["death"]
                }
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

Note: You can also spawn custom spawn egg items using the minecraft:spawn_entity component by setting "spawn_item" to be your entity's id and an affix of spawn_egg, and it will look something like this.

BP/entities/my_entity.json#components
json
{
    "minecraft:spawn_entity": [
        {
            "min_wait_time": 0,
            "max_wait_time": 0,
            "spawn_item": "wiki:custom_zombie_spawn_egg",
            "single_use": true
        }
    ]
}
1
2
3
4
5
6
7
8
9
10

If you want to drop a loot table, you can trigger an event (as shown below) and summon another entity that have this component:

json
{
    "minecraft:behavior.drop_item_for": {
        "seconds_before_pickup": 0.0,
        "cooldown": 5,
        "drop_item_chance": 1,
        "offering_distance": 0.0,
        "minimum_teleport_distance": 1024.0,
        "target_range": [64.0, 64.0, 64.0],
        "teleport_offset": [0.0, 1.0, 0.0],
        "speed_multiplier": 1.0,
        "search_range": 64,
        "search_height": 64,
        "search_count": 0,
        "goal_radius": 64.0,
        "entity_types": [
            {
                "filters": {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player"
                },
                "max_dist": 64
            }
        ],
        "priority": 1,
        "loot_table": "loot_tables/entities/example.loot_table.json",
        "time_of_day_range": [0.0, 1.0]
    },
    "minecraft:timer": {
        "time": 2,
        "time_down_event": {
            "event": "wiki:my_despawn_event"
        }
    }
}
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
30
31
32
33
34
35

And then despawn it through adding component group with instant_despawn through wiki:my_despawn_event.

Detecting Death with Commands ​

View

Contributors

Edit Custom Death Animations on GitHub

Bedrock Wiki by Bedrock OSS

"Minecraft" is a trademark of Mojang AB.

Bedrock OSS, Bedrock Wiki and bedrock.dev are not affiliated in any way with Microsoft or Mojang AB.

  • Privacy Policy
  • Join our Discord
  • Learn how to Contribute
  • Visit our Repository