Command Blocks In Minercaft Giving items On Kills

Command Blocks In Minercaft Giving items On Kills - Assorted-color Bricks

Could I make it so that when I kill a player for the first time, a command block gives me an iron sword, on my second kill it gives me a diamond sword, on my third kill it gives me an enchanted item, and so on?

I also want a way to reset this, as well as a start button. I know a way that I can do this by doing /scoreboard objectives add objectivename playerKillCount, and then a comparator does /give @p iron_sword. However, if I am too far from the command block and another player is next to it, the command block will give the sword to them instead. Also, @p won't work for the whole world, because I have to be near it. Can somebody please help me with a way that I can do this?






Pictures about "Command Blocks In Minercaft Giving items On Kills"

Command Blocks In Minercaft Giving items On Kills - Cheerful crop African American female owner giving treat to Labrador Retriever while teaching commands in park
Command Blocks In Minercaft Giving items On Kills - Dog giving paw to anonymous person
Command Blocks In Minercaft Giving items On Kills - White Cat Sitting on a Balcony with Lots of ItemsĀ 



How do you get items when you kill someone in Minecraft?

Examples
  • To kill the player executing the command: kill @s.
  • To kill the player Steve: kill Steve.
  • To kill item entities: kill @e[type=item]
  • To kill all entities within 10 blocks: ...
  • To kill all entities except players: kill @e[type=!player]
  • To kill all creepers within 10 blocks:


  • How do you kill things with command blocks?

    You can give a player any item whenever you want using the /give command in Minecraft.

    What is the command to give a player items in Minecraft?

    One of the most popular and fastest ways to clear items is the kill command. First, type /kill @e[type=item] in the chat and press enter to remove all dropped items in your Minecraft world instantly. However, you will need to have operator status and enable cheats in your world for this command to work.



    Minecraft 1.16 Kill Reward System // Command Block Tutorial




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

    Images: Sharon McCutcheon, Samson Katt, Leon Natan, billow926