Give player item(s) when player hits X amount of deaths

Give player item(s) when player hits X amount of deaths - A Man Playing Gold on the Field

I'm making a game where you have to destroy the most blocks possible, but some blocks can kill you so if you die too many times or whatever the threshold is set to you get an item to give you advantage over other players. There will be a max of 4 people but i want them to each have their own death count so it gives the items to that specific person but the command block can't tell who died and when to give the item to them, which is why I am trying to set each player with a objective manually because I will be playing with my friends.

So far I have gotten to the phase of the commnd block, where it works by giving me the item, but the testfor I made keeps searching for me again because i still have those deaths counted. That's why i need to somehow then reset the objective, but I can't.

Basically I want to make it so when you die X amount of times you get some item(s) when you hit X deaths, but no matter how many times I try and add the proper console commands in some tutorial videos they don't work, example:

/scoreboard objectives add PlayerKills playerKillCount

Changing player kills to Deaths and playerKillCount to deathCount then using this command in the actual command block:

/give @a [score_Deaths_min=1] iron_sword

I fixed the problem thanks i created different teams put the players on different teams then created objectives for each player and set them each to their deathCount and made everytime testfor found 5 deaths it reset the deaths and gave them items.



Best Answer

Your first command is fine if you are changing it as you say.

The problem appears to be that you have a space between the selector (@a) and the selector arguments ([score_Deaths_min=1]), when there shouldn't be one. Try this command instead:

/give @a[score_Deaths_min=1] iron_sword



Pictures about "Give player item(s) when player hits X amount of deaths"

Give player item(s) when player hits X amount of deaths - Photo Of Person Playing Soccer On The Field
Give player item(s) when player hits X amount of deaths - Man in White T-Shirt and Black and White Pants Playing Golf
Give player item(s) when player hits X amount of deaths - Focused multiethnic friends playing billiard together in spacious room



How do you give a player an item after death in Minecraft?

To keep your items after you die in Minecraft, make sure to first enable cheats within the in-game menu. After loading into a world, open the console and input the command, \u201c/gamerule keepInventory true.\u201d As a result, inventory items will now never be lost upon death.

How do you make something not lost on death in Minecraft?

If the player has their F3 menu open on Java Edition, the coordinates will remain on the screen after the death screen appears. This can allow players to write down their coordinates and backtrack to them if needed.



Roblox Studio How to Give Players Items when they Spawn, Give Gear, Weapons or Other Objects




More answers regarding give player item(s) when player hits X amount of deaths

Answer 2

Simple, just use the deathCount criteria for your scoreboard objective.

/scoreboard objectives add Deaths deathCount Deaths

Then use the command:

/give @a[score_Deaths_min=(Desired Amount)] (Item) (Amount) (Data Value) {Data Tag}

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: cottonbro, RF._.studio, cottonbro, Alexander Suhorucov