3
Datapack help
When player killing player, he gets 8 emeralds with NBT
I need this mechanic in my datapack for map
Version - 1.21.4
I need this mechanic in my datapack for map
Version - 1.21.4
2
Beyond my area of comfort, but this might be doable if approached by checking if the player dieing is being killed by a player and adding the emeralds to the dropped inventory.
Note that I don't know how to do this, but …
From https://minecraft.wiki/w/Death_messages#Players_and_mobs
This death message is actually two different death messages: <player> was slain by <mob> and <player> was slain by <player>.
* This means they can be customized completely independently of each other using resource packs.
So if you know B has been killed by A, you also know A has killed B
That should also be usable to trigger a function to either give the emeralds to A, or to summon the emeralds at A's location.
EDIT: possibly the emeralds could be added to B's invetory before it is dropped?
If/When you work out how to implement the idea, please post as I'm still in the learning stage…
Note that I don't know how to do this, but …
From https://minecraft.wiki/w/Death_messages#Players_and_mobs
This death message is actually two different death messages: <player> was slain by <mob> and <player> was slain by <player>.
* This means they can be customized completely independently of each other using resource packs.
So if you know B has been killed by A, you also know A has killed B
That should also be usable to trigger a function to either give the emeralds to A, or to summon the emeralds at A's location.
EDIT: possibly the emeralds could be added to B's invetory before it is dropped?
If/When you work out how to implement the idea, please post as I'm still in the learning stage…
players have their own loot table, so the emeralds could theoretically be added to there with the killed_by_player condition.
