Minecraft : Problem with 1.9 command blocks

minecraft-commandsminecraft-java-edition

I'm planning to make a map with custom classes and special abilities in Minecraft with the "new" 1.9 command blocks (although its been 2 years since 1.9 came out, the last time I fiddled with commands was on 1.8, so I'm confused).

Cutting to the chase, I was utterly confused due to the new types of command blocks and how to use them respectively.Here were my issues :

  1. I planned to detect a Giant named Dinnerbone that is on the ground, but for some reason the /testfor @e[type=Giant,name=Dinnerbone] {onGround:1b} command didn't work at all.Perhaps the onground tag was removed after 1.9?

  2. I planned to do a chain of commands on the Giant once it's score on a scoreboard named GiantTimer reaches 0 from 200, with it's score is constantly decreasing by a Repeated command block. I don't know how you could make a single line of command blocks to set the score to 200, remove it 20ticks/s using the repeated command block, and once it reaches zero activate a chain of commands on the Giant with a score of 0. I know the commands to do all these, but I don't get how you can detect when the score reaches 0 and then activate a line of command blocks; I do not know the right combination of the various command blocks to do these. Do you need more columns of command blocks to do that? Set it to Repeat or Conditional? I want the effects from the chain of commands after it detects the score is 0 to happen only once, not repeatedly.

Best Answer

This wasn't a 1.9 change, but types have to be lowercase now: giant instead of Giant. A full list is here.

If you want to activate a line of command blocks conditionally, put a testing command (testfor, testforblock, testforblocks or anything else that can succeed or fail) into a repeating command block and place another repeating command block, this one conditional, so that its back faces the first command block (because that's how "conditional" works). A normal straight line of command blocks also works. Then you just continue normally with chain command blocks, they don't have to be conditional (but can be if you want to make them depend on the previous one).
How this works: The first repeating command block tests the condition in every tick, the second repeating command block checks for the success of the first one every tick, but only runs if the first one was successful and only then it also activates the chain command blocks in front of it.

For the future: Please only ask one question per question. I've answered both now because the first one is really trivial.

Related Topic