350: Is player following checkpoint path? Race lap counter. [Minecraft Map Making]

Ойындар

Ep350: Making a path of checkpoints and checking if the player goes through each one. Then making that into a lap counter for a race.
00:30 Setup
02:15 Give eggs
04:15 Controller - place
08:40 Controller - remove
12:10 Temporary reset
13:05 Checkpoint counter
16:05 Controller - main
Version: 1.19
Commands, builds and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel: / coppitj
Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord: / discord
The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.
Since angled brackets are not allowed in KZread descriptions you will have to replace "greater than" and "less than" with the appropriate angled bracket.
Commands used:
Setup:
IUN: scoreboard objectives add marker.id dummy
CUA: scoreboard objectives add laps dummy
CUA: scoreboard players set .target_laps laps 3
CUA: scoreboard players set .target_checkpoints marker.id 3
Give Egg Place:
IUN: give @p slime_spawn_egg{display:{Name:'{"text":"Checkpoint Marker"}'}, EntityTag:{id:"minecraft:marker", Tags:["checkpoint_place"]}}
Give Egg Remove Last:
IUN: give @p strider_spawn_egg{display:{Name:'{"text":"Checkpoint Marker"}'}, EntityTag:{id:"minecraft:marker", Tags:["checkpoint_remove"]}}
Controller Place Marker:
RUA: execute at @e[tag=checkpoint_place] run summon marker ~ ~ ~ {Tags:["checkpoint"]}
CUA: execute as @e[tag=checkpoint] unless score @s marker.id = @s marker.id store result score @s marker.id run scoreboard players add .id_holder marker.id 1
CUA: kill @e[tag=checkpoint_place]
Controller Remove Last Marker:
RUA: execute at @e[tag=checkpoint_remove] run kill @e[tag=checkpoint,sort=nearest,limit=1]
CCA: scoreboard players remove .id_holder marker.id 1
CUA: kill @e[tag=checkpoint_remove]
Controller Main:
RUA: execute as @a[x=69, y=56, z=374, dx=0, dy=2, dz=2] unless score @s marker.id matches 1.. run scoreboard players set @s marker.id 1
CUA: execute at @a[scores={marker.id=1..}] as @e[type=marker, tag=checkpoint, distance=..1] if score @s marker.id = @p marker.id run scoreboard players add @p marker.id 1
CUA: execute as @a[x=69, y=56, z=374, dx=0, dy=2, dz=2] if score @s marker.id = .target_checkpoints marker.id store success score @s marker.id run scoreboard players add @s laps 1
CUA: execute as @a[x=69, y=56, z=374, dx=0, dy=2, dz=2] if score @s laps = .target_laps laps run say I win!
Reset:
IUN: scoreboard players set @p marker.id 0
CUA: scoreboard players set @p laps 0
Set Checkpoint count:
IUN: scoreboard players set .target_checkpoints marker.id 0
CUA: execute as @e[type=marker, tag=checkpoint] if score @s marker.id "greater than" .target_checkpoints marker.id run scoreboard players operation .target_checkpoints marker.id = @s marker.id
CUA: scoreboard players add .target_checkpoints marker.id 1

Пікірлер: 12

  • @vibre8815
    @vibre88158 күн бұрын

    comment for algorithm

  • @InfernalDevice

    @InfernalDevice

    7 күн бұрын

    1: Once upon a time there was three little comments that lived near the forest. The first comment was lazy and built his house out of straw so he finished quickly and spent the rest of the day playing and having fun, while the other two were still working. One day the big bad algorithm came along, the little comment ran into his house to hide, but the big bad algorithm huffed and puffed and blew his house down and gobbled up the lazy comment.

  • @hasantopcu556
    @hasantopcu5569 күн бұрын

    if you don't need to see the uuids, you can hide the uuids of all markers in the scoreboard and make them appear with the name "marker" with the command below so that they don't look ugly on the screen. This way UUID's won't take up half the screen. RUA: "execute as @e[type=minecraft:marker] at @s if score @s test = @s test run scoreboard players display name @s test {"text":"marker","color":"aqua"}"

  • @InfernalDevice

    @InfernalDevice

    9 күн бұрын

    I thought that was a newer command. Does it work in 1.19 as well? Cool.

  • @hasantopcu556

    @hasantopcu556

    9 күн бұрын

    @@InfernalDevice I think it was added in 1.20.3, you can change the color and bold of the numbers as well as the names. You can also hide numbers.

  • @InfernalDevice

    @InfernalDevice

    9 күн бұрын

    @@hasantopcu556 I have used it in later versions. It's a very nice addition.

  • @hasantopcu556

    @hasantopcu556

    9 күн бұрын

    @@InfernalDevice A video suggestion: you can make a power selector with this by hiding the numbers and coloring the names. For example, there are 3 options, "speed" "jump" "resistance". Every time we right click or shift it selects the next power, the color of the selected power will be green and the other powers will be grey.

  • @InfernalDevice

    @InfernalDevice

    9 күн бұрын

    @@hasantopcu556 That's a interesting idea. The player can cycle through "powers" which are displayed on the sidebar. I like it, thank you. :)

  • @aviationking8588
    @aviationking85888 күн бұрын

    Omg

  • @InfernalDevice

    @InfernalDevice

    7 күн бұрын

    Wow! :)

  • @hasantopcu556
    @hasantopcu5569 күн бұрын

    Why do you summon a marker with the "checkpoint_place" tag instead of summoning a marker directly with the checkpoint tag?

  • @InfernalDevice

    @InfernalDevice

    9 күн бұрын

    Habit, lol.

Келесі