Can scoreboards detect if a player is killed with a specific item?

[BACK]
Can scoreboards detect if a player is killed with a specific item?
Posted On: March 14, 2024

I'm making a sword that will gain attack damage every time a player gets a kill with it. I think I can get the sword attributes to change based on a scoreboard, but I don't know if I can make a scoreboard that detects if a player is killed by someone using the sword. Does anyone know if this is possible, and if so, how would I do it?


Question from user VeryHotClara at gaming.stackexchange.com.


Answer:

Give yourself an item, for example a sword, include this nbt:.


{customid:"leveling_sword",AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:1,Operation:0,UUID:[I;1634486241,408504796,-1808684184,1791120101],Slot:"mainhand"}]}.


It doesn't matter what the UUID is because we will use a custom NBT tag.


Setup commands (run once):.


`/scoreboard objectives add kill playerKillCount kill```\.


For the looped commands you either put them in this order using 1 repeating and multiple chain command blocks, or just use a function in a datapack.


Looped commands:.


/execute as @a[scores={kill=1..},nbt={SelectedItem:{customid:"leveling_sword"}}] run .


/scoreboard players set @a kill 0.


For the part I'm not sure on the exact stuff to do. I know 2 options but I don't have time rn so imma just post this and someone else might have a better idea.


Option one is to replace the first command with /item:.


item modify @a[scores={kill=1..},nbt={SelectedItem:{customid:"leveling_sword"}}] where points to a json file in a loaded datapack.


https://minecraft.wiki/w/Item_modifier.


Option two is to use /data using NBT path format which doesn't require a datapack. However you can't use /data on a player so you first have to move the item to another entity like an armor stand. You might need one armor stand per player in case there are 2 kills on the same game tick. A possibility is to put a marker armor stand on each player's head using /ride.


Answer from user Samstercraft at gaming.stackexchange.com.


[BACK]
Can scoreboards detect if a player is killed with a specific item?
Posted On: March 14, 2024

I'm making a sword that will gain attack damage every time a player gets a kill with it. I think I can get the sword attributes to change based on a scoreboard, but I don't know if I can make a scoreboard that detects if a player is killed by someone using the sword. Does anyone know if this is possible, and if so, how would I do it?


Question from user VeryHotClara at gaming.stackexchange.com.


Answer:

Give yourself an item, for example a sword, include this nbt:.


{customid:"leveling_sword",AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:1,Operation:0,UUID:[I;1634486241,408504796,-1808684184,1791120101],Slot:"mainhand"}]}.


It doesn't matter what the UUID is because we will use a custom NBT tag.


Setup commands (run once):.


`/scoreboard objectives add kill playerKillCount kill```\.


For the looped commands you either put them in this order using 1 repeating and multiple chain command blocks, or just use a function in a datapack.


Looped commands:.


/execute as @a[scores={kill=1..},nbt={SelectedItem:{customid:"leveling_sword"}}] run .


/scoreboard players set @a kill 0.


For the part I'm not sure on the exact stuff to do. I know 2 options but I don't have time rn so imma just post this and someone else might have a better idea.


Option one is to replace the first command with /item:.


item modify @a[scores={kill=1..},nbt={SelectedItem:{customid:"leveling_sword"}}] where points to a json file in a loaded datapack.


https://minecraft.wiki/w/Item_modifier.


Option two is to use /data using NBT path format which doesn't require a datapack. However you can't use /data on a player so you first have to move the item to another entity like an armor stand. You might need one armor stand per player in case there are 2 kills on the same game tick. A possibility is to put a marker armor stand on each player's head using /ride.


Answer from user Samstercraft at gaming.stackexchange.com.


[BACK]

Meeting specific person at the end of Life Is Strange Before The Storm Meeting specific person at the end of Life Is Strange Before The Storm

Posted On: May 9, 2023
I just ended a game. After the credits, I noticed that there is the possibility of: . Rachel meeting her mother - Sera. I searched the internet for clues on how I can make this happen. I then re...[More]


In Hogwarts is how do I get to this chest behind the revolving statues? In Hogwarts is how do I get to this chest behind the revolving statues?

Posted On: February 12, 2023
There are some caves that has these chests behind the revolving statues. Standing on the platform rotates and you end up on the other platform, rather than the other side of the wall. How do I get ...[More]


How to connect storage items with stills? How to connect storage items with stills?

Posted On: January 17, 2023
I'm pretty new to dwarf fortress, so sorry if this question doesn't make sense. I've been trying to use a still, but most of the options are unavailable because it needs an empty storage i...[More]


Importing worlds in Minecraft on Android: missing games folder Importing worlds in Minecraft on Android: missing games folder

Posted On: July 17, 2023
I've downloaded a world from the internet and now want to play it in Minecraft PE on Android. I've found tutorials online but they say I have to extract the world folder into a folder named &q...[More]


Do I sell my legendary Kraken cloak in favour of a superb one? Do I sell my legendary Kraken cloak in favour of a superb one?

Posted On: September 24, 2023
My legendary Kraken cloak provides me with 14 defence while my Superb cloak provides me with 18 defence. Should I sell my legendary gear? I’m pretty new to this game, so don’t really know ...[More]


Is there a way to tell how much extra heal and shield power you have? Is there a way to tell how much extra heal and shield power you have?

Posted On: September 30, 2023
I am playing Soraka in League of Legends and her main role is to heal her allies, so shes buys items to help. Some of the best items for Soraka are items that give more healing power for example the i...[More]


This is why people ship them This is why people ship them

Posted On: January 27, 2025
Question from user OCDurge at BaldursGate3 at reddit.com.Answer:At the epilogue party, Dammon writes her a letter saying he thinks about her often and basically begs her to write him back!.Answer from...[More]


How can I see which character has finished a certain level? How can I see which character has finished a certain level?

Posted On: December 19, 2023
I've played most of the levels in Super Mario 3D World with Princess Peach and after I've got Rosalina, then with her. If I want to reach the golden stars for the levels, I have to play each l...[More]


How do I survive the vampire attack during the Bloodchill Manor quest? How do I survive the vampire attack during the Bloodchill Manor quest?

Posted On: January 23, 2023
I've tried several times to live and not contract Sanguinare Vampiris (although, I've only been using Lifeblood, my dwarven warhammer enchanted with the health-point-steal and not the Flames s...[More]


Lae'Zel death Lae'Zel death

Posted On: March 15, 2026
Acabei de eliminar os membros da Absolute na ponte, aqueles com o dragão e que matam mercenários com o Punho Flamejante, mas quando fui verificar os corpos, Lae'zel estava morta entre eles, e eu nem...[More]