drop item on death
title, i have a deathcount objective, when someone dies it adds one to it, than it runs a function which sets it to 0 and does /summon item to drop the item on death, but it summons it at the players spawnpoint, not where someone dies, any ideas? im on 1.21.
when you die it runs:
Continue to help postexecute as @a[scores={Deaths=1..}] run function artifact:died
which then in died has
execute as @s[scores={Artifacts=12}] run summon item ~ ~ ~ {Item:{id:"minecraft:potion",count:1,components:{"minecraft:item_name":'{"color":"light_purple","italic":false,"text":"Dragon Potion"}',"minecraft:lore":['{"color":"light_purple","italic":false,"text":"What is this power I feel?"}'],"minecraft:hide_additional_tooltip":{},"minecraft:custom_model_data":11,"minecraft:potion_contents":{potion:"minecraft:water",custom_color:16536828}}}} execute as @s[scores={Artifacts=12}] run scoreboard players set @s Artifacts 11 execute as @s[scores={Runes=-4..}] run tellraw @s {"color":"green","italic":false,"text":"You Died And Lost A Rune!"} execute as @s[scores={Runes=..-5}] run tellraw @s {"color":"green","italic":false,"text":"You Died But Are at -5 Runes!"} execute as @s[scores={Runes=-4..}] run scoreboard players remove @s Runes 1 tag @s add Died scoreboard players set @s Deaths 0
The artifacts 12 thing is the summoning on death. thanks