I am making a bosses datapack with new custom swords. I want a custom boss to summon a custom item if it was killed by a player with a 10% chance for the item to spawn. I know the killed_by_player and the custom chance predicates exist, but I'm confused about how to use 'execute if predicate' on a dead mob. If anyone can give me a simple execute command which will summon an item on a entity when it has been killed by a player, I would be very grateful :D
Thanks, and have a great day!
Thanks, and have a great day!
4
[deleted]
eg this command: "/summon pig ~ ~ ~ {DeathLootTable:"minecraft:chests/abandoned_mineshaft"}"
have you considered the DeathLootTable tag?
cuz loot tables can use predicates, and the DeathLootTable tag lets you set a custom loot table on death.
So maybe you could have a loot table with a 10% chance to drop it, and a killed_by_player condition.
cuz loot tables can use predicates, and the DeathLootTable tag lets you set a custom loot table on death.
So maybe you could have a loot table with a 10% chance to drop it, and a killed_by_player condition.
You would need to make another mob/AEC a passenger of the boss, which detects if the mob its on is dead before using the predicate and disappear.
This video basically explains the concept even though it is 1.12.
If you need actual command examples just comment that you need some
This video basically explains the concept even though it is 1.12.
If you need actual command examples just comment that you need some
