How to test if someone died twice and then put them in creative with invisiblite x in command blocks

How to test if someone died twice and then put them in creative with invisiblite x in command blocks - Couple of coworkers in aprons and casual clothes watering plants and putting signboard near cafeteria in daytime

I am doing a minigame map, and there are a couple events I want to set-up:

  • If someone dies twice they will be eliminated and put into creative with invisibility X
  • If all of a persons wool is captured, and placed on an enemy stand, the owner of the wood is eliminated.

I do not have a scoreboard set up yet, but if someone could tell me how to do what I said above that would be great.

Senario



Best Answer

This is pretty straightforward once you are used to all of the commands required for scoreboard related things (seriously, there's a lot).

First of all, we need to set up a "Deaths" objective:

/scoreboard objectives add Deaths deathCount

This will keep track of player deaths, and increment automatically when the player dies. Now, we want to put players with a Deaths score of 2 in spectator mode. To do this, I'm going to use the @a selector, with

/gamemode 3 @a[score_Deaths_min=2,m=0]

What this command does is puts all players who are currently in survival mode and have a deaths score of at least 2 into spectator mode. That part is pretty straightforward.

The next bit is... a little trickier (mainly because I'm not entirely sure what you're trying to accomplish specifically). But for this, you're going to want a few /testforblock commands. The syntax for this is as follows:

/testforblock X Y Z tileName dataValue dataTag

This command outputs a redstone signal via comparator if the condition is true when the command block receives a pulse.

For example, let's say I wanted to see if there was an orange wool block at (0,64,23). The command for this would be

/testforblock 0 64 23 minecraft:wool 1

In the case of wool, the data value corresponds to the color of the wool. See this page on the Minecraft Wiki for a reference.

You can use a few of these with an AND gate of some variety, and you can test for as many of these conditions as you like.

Oh! Also, to reset the game, you're going to want to clear out the death counter (otherwise things won't work properly when you restart). To do this, use this command:

/scoreboard players set @a Deaths 0

What this does is sets the deaths score of all players to 0, allowing the game to restart.




Pictures about "How to test if someone died twice and then put them in creative with invisiblite x in command blocks"

How to test if someone died twice and then put them in creative with invisiblite x in command blocks - Laboratory tubes with colorful glitter on pink desk
How to test if someone died twice and then put them in creative with invisiblite x in command blocks - Crop faceless female florist putting bouquets of flowers in fridge while working in floral shop
How to test if someone died twice and then put them in creative with invisiblite x in command blocks - Faceless women applying multicolored eyeshadows on wrist for testing



How can you tell if someone died in Minecraft?

To testfor player's death, put in another command block: /testfor @a[score_deaths_min=<number of deaths>] . And there you go!

How do you find where a Minecraft player died?

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.

How can you tell if a player is standing on a certain block?

You can test whether there is a certain block at a specific location in the game using the /testforblock command in Minecraft....TestForBlock Command in Minecraft Java Edition (PC/Mac)
  • x y z is the coordinate to test. ...
  • block is name of the block to test for. ( ...
  • dataValue is optional. ...
  • dataTag is optional.




  • How To Detect When a Player Dies in Minecraft Using Commands




    More answers regarding how to test if someone died twice and then put them in creative with invisiblite x in command blocks

    Answer 2

    set scoreboard to deaths, detect if someone died twice, if true, send redstone inpulse to a command block that puts them in spec. mode(new to 1.8).

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

    Images: Tim Douglas, Alena Shekhovtcova, Amina Filkins, George Milton