1
Execute Function Link Help
This is a bit of a longshot as Ive looked through the different mobs and chests and things to check first. But is there a way to make mobs that die execute a command or function? I would thing with how Java works there would be a way to do this, even if its through a function substitute or something, but I'm not sure. I could have swore Ive seen other datapacks that do this, but with mob summoning instead.
For example, if when a mob dies, it executes a command to say a random death message from 1 of 10 different messages. Or if a mob is squished from cramming or fire, it drops a different item (sorta like how meat drops cooked).
For example, if when a mob dies, it executes a command to say a random death message from 1 of 10 different messages. Or if a mob is squished from cramming or fire, it drops a different item (sorta like how meat drops cooked).
2
you can do that with loot tables (the drops atleast) you can specify how the mob has to die (very detailed, like biome, type of death, killer, etc, even coords)
So you can modify the look like that, and technically you could add specific loot to specific deaths, detect that loot, then execute the death message, and delete the loot (if u have to) [You can add nbt tags to identify the loot without actually changing the functionality or look of the item)
Thats a bit more work then what the first comment suggested, but you can customize it waaaay more
So you can modify the look like that, and technically you could add specific loot to specific deaths, detect that loot, then execute the death message, and delete the loot (if u have to) [You can add nbt tags to identify the loot without actually changing the functionality or look of the item)
Thats a bit more work then what the first comment suggested, but you can customize it waaaay more
Set up a scoreboard
/scoreboard objectives add health dummy
Save the health to that scoreboard
execute as @e store result score @s health run data get entity @s Health
Run a command based on the health value being zero
execute as @e[scores={health=0}] at @s run <COMMAND>
/scoreboard objectives add health dummy
Save the health to that scoreboard
execute as @e store result score @s health run data get entity @s Health
Run a command based on the health value being zero
execute as @e[scores={health=0}] at @s run <COMMAND>
