BasketMC

UHC Gift Basket Command Block Stream, Part 2 of 3

  • Published on

The second hour of the UHC Gift Basket stream picks up right where the first stopped: the game time is "still really big," and the day time resets every morning. Basket needs a clock that keeps counting, so this part builds one out of a day counter. With the clock fixed, the Soul Crusher warning and shrink timers finally fire on time, and a new grid of command blocks gets ready to shrink the border by the number of players. The border still does not actually move by the end.

A clock that counts days

Basket searches the command pages for a replacement. In 1.8, the time query "used to tell me the time all the way into the game," and "a lot of my commands are set up, assuming I can get that value." Now the day time only gives "the time so far today." The game time does not help either, because the plan is to freeze time while players start out.

The answer is to count days. Basket pulls the clock out of the old design and sets the time query block to repeat, unconditional, always on. A fire resistance effect from the startup routine, meant to keep players from landing in lava after they are spread out, gets cleared with a milk bucket.

Then the time of day variable freezes. A misspelled "variables" is one bug. Basket shuts off every piece of redstone nearby to be sure nothing else is setting it. The fix is to make the second block a chain block pointed at the query block. "I would have thought that having them both on repeat would have worked but I guess not."

A command block window with the command "/scoreboard players test TimeOfDay GameVariables 0 0" and the Repeat, Unconditional and Always Active buttons

Next comes a test for the start of the day, when the time of day is exactly zero. The game will now start at time 1, and setting the time to just before morning shows the test fires once. "So it only triggered once." Each morning adds one to a Days variable, which resets to zero at the start. The clock becomes the days times the day length, plus the time of day.

Testing the two minutes

Copying blocks into a neat row breaks things for a while. A copied block lost its conditional setting and kept adding days, so the clock shot up. After a short break card, the stream comes back with the clock steady.

Three long rows of green chain command blocks, each led by a purple repeating command block, on a bedrock platform

Basket kills the character to trigger the warning and starts a real two-minute timer. The countdown on the scoreboard drops as it should, and the shrink message comes "exactly" at two minutes. The state moves to 2 and a new target sits five minutes out. Two more deaths raise the Soul Crusher count to two, so the loop should run again. It does, though the timer seems 30 seconds slow, until Basket works it out: "the game pauses every time I go into a command block." The count goes down by one and the whole process restarts.

Shrinking by player count

The big question is whether the border can shrink by an amount stored in a variable. The world border command only takes a number, and "I need like an eval statement." Basket finds no way to do that with commands.

So the shrink becomes a grid. Each row checks for a pending shrink and one player count, then sends a message with that count's share: 2,000 minus a 100 block middle, divided by the number of players. The rows cover four to ten players. Placing them floods the chat until each block is set to conditional.

Green chain command blocks laid side by side on bedrock while the chat repeats "shrink by (2000-100)/9"

To test it, Basket sets the player count to six ("we will lie to the game") and dies again. Later the chat shows "shrink by (2000-100)/6," the right row. The rows still send a message instead of running the border command. A firework sound plays in the chat log, but Basket hears nothing and adds it to a list of broken things. Signs label the clock, days, time of day and reset blocks.

A message with the day in it

The next goal is an end-of-episode message that includes the day number. A viewer points out the tellraw command can take a selector, and a test prints "BasketMC has won the game!" Basket digs through tellraw options for a way to show a score, and drafts a red, bold "Day 13. Players remaining:" message.

Chat lines over command blocks: "Set score of GameVariables for player PlayerCount to 6", "Soul Crusher will wake in 2 minutes!", "BasketMC has won the game!", "Soul Crusher is coming!" and "shrink by (2000-100)/6"

Where it ends

Setting the time by hand does not move the day counter, so Basket chains those blocks together, sees the clock "going crazy" from an unconditional block, and resets everything. The clock is counting up again when Basket steps away, and this part of the stream ends there.