first thing:i need to set up a mechanism with scoreboards than when a player dies (so the objective health goes zero) it gives him a set of leggings and boots
second thing:some explanation on how does the command execute works
if you could help me it would be very nice , oh and if i made some mistakes tell me because its the first time in this forum .
1.13.2
java edition
singleplayer(probably i will use it in multiplayer)
The next one would be a conditional chain command block connected to the first containing:
/scoreboard players set @a[scores={[death score name]=1}] [death score name] 0
Then just duplicate those two for each item you want to give to the dead player (changing the given item of course). Additionally you would want to have a repeating command block (unconnected to the rest) with:
/scoreboard players add @a [death score name] 0
This is done so that every player is targetable by the previous commands.
For the second thing you can think of the new execute command as a combination of a couple previous ones. The execute command has the as argument which will run the ending command as if the targeted player ran it (similar to the previous execute). An example would be:
/execute as @a run setblock ~ ~-1 ~ minecraft:stone
This would run the "/setblock ~ ~-1 ~ minecraft:stone" command as if every player in-game typed it in. However the command would still run at the command block's location (setting the block below the command block to stone). This is where the at argument comes in. Using at you can run a command at the location of the chosen target. For example:
/execute at @a run setblock ~ ~-1 ~ minecraft:stone
This would run the "/setblock ~ ~-1 ~ minecraft:stone" command at the location of every player (setting the block below every player to stone). You can also combine these two selectors (one after another) to have more specific commands. Example:
/execute as @e[type=minecraft:cow] at @e[type=minecraft:cow,tag=Steve] run summon minecraft:creeper
This would summon a creeper at the location of any cow with the tag of Steve for every cow in-game. So if you had one cow tagged Steve and one cow with no tag the above command would summon two creepers at Steve's location. Those are the basics but there are many more arguments available. Here's a list from the wiki
first thing:i need to set up a mechanism with scoreboards than when a player dies (so the objective health goes zero) it gives him a set of leggings and boots
second thing:some explanation on how does the command execute works
if you could help me it would be very nice , oh and if i made some mistakes tell me because its the first time in this forum .
1.13.2
java edition
singleplayer(probably i will use it in multiplayer)
You can use an objective set to player deaths (probably works better than health). The first command would be repeating and would contain:
The next one would be a conditional chain command block connected to the first containing:
Then just duplicate those two for each item you want to give to the dead player (changing the given item of course). Additionally you would want to have a repeating command block (unconnected to the rest) with:
This is done so that every player is targetable by the previous commands.
For the second thing you can think of the new execute command as a combination of a couple previous ones. The execute command has the as argument which will run the ending command as if the targeted player ran it (similar to the previous execute). An example would be:
This would run the "/setblock ~ ~-1 ~ minecraft:stone" command as if every player in-game typed it in. However the command would still run at the command block's location (setting the block below the command block to stone). This is where the at argument comes in. Using at you can run a command at the location of the chosen target. For example:
This would run the "/setblock ~ ~-1 ~ minecraft:stone" command at the location of every player (setting the block below every player to stone). You can also combine these two selectors (one after another) to have more specific commands. Example:
This would summon a creeper at the location of any cow with the tag of Steve for every cow in-game. So if you had one cow tagged Steve and one cow with no tag the above command would summon two creepers at Steve's location. Those are the basics but there are many more arguments available. Here's a list from the wiki
Hope this helps!