# Coole Commands

### Wiederholende CmdB

#### Highway / Rennbahn Glas

Wie dus aus TurtleCity kennst:

<figure><img src="https://github.com/KidsLabDe/docs/blob/master/minecraft/.gitbook/assets/highway.png" alt=""><figcaption></figcaption></figure>

```mcfunction
execute as @a at @s if block ~ ~-1 ~ minecraft:black_stained_glass run effect give @s minecraft:speed 1 10 true
```

wenn dus schneller magst kannst du statt der 10 auch andere speed boosts z.B. 20 aussuchen. Statt schwarzem Glas (black\_stained\_glass) kannst au auch jeden anderen Block als auslöser wählen

#### Aufzug

Wie dus aus TurtleCity kennst:

<figure><img src="https://github.com/KidsLabDe/docs/blob/master/minecraft/.gitbook/assets/aufzug.png" alt=""><figcaption></figcaption></figure>

```mcfunction
execute as @a at @s if block ~ ~2 ~ minecraft:white_stained_glass run tp @s ~ ~1 ~
execute as @a at @s if block ~ ~ ~ minecraft:white_stained_glass if block ~ ~2 ~ air run tp ~ ~1 ~
```

auch hier kannst du selber wählen welchen Block du möchtest, nicht durchsichtige Blöcke geben dir jedoch schaden wenn du in ihnen stehst!

#### Spawnpunkt Schutz

Setzt alle Spieler die nicht Administratoren sind und in einem Radius `distance` um den Spawn sind in den Adventure-Modus, und alle Spieler ausserhalb des Radius in den Survival-Modus. Administratoren müssen den tag `admin`haben.

```mcfunction
execute as @a[distance=..50,x=100,y=64,z=100,tag=!admin] run gamemode adventure
execute as @a[distance=50..,x=100,y=64,z=100,tag=!admin] run gamemode survival
```

Wichtig ist, dass ihr die `x`, `y` und `z` Koordinaten in den Befehlen an euren Spawnpunk anpasst! Administratoren kann mit folgendem command (Nicht im Commandblock, sondern im Chat) der `admin` tag gegeben werden, damit sie nicht beeinflusst werden:

```mcfunction
/tag <player> add admin
```

`<player>`einfach mit dem Spielernamen ersetzen.

#### Kletternder Schleim

<figure><img src="https://github.com/KidsLabDe/docs/blob/master/minecraft/.gitbook/assets/schleim-treppen.png.png" alt=""><figcaption></figcaption></figure>

```mcfunction
execute at @e[type=slime] run setblock ~ ~-1 ~ minecraft:slime_block
```

Du kannst statt einem Schleimblock auch mal TNT verwenden xD

#### Feuer Ziege

brennt alles an, sich selbst auch ...

```mcfunction
execute at @e[type=goat] run fill ~-1 ~-1 ~-1 ~1 ~1 ~1 fire replace air
```

#### Schnellschuss Armbrust

```mcfunction
item replace entity @a[nbt={SelectedItem:{id:"minecraft:crossbow"}}] weapon.mainhand with crossbow[charged_projectiles=[{id:"minecraft:arrow",count:2}]]
```

#### TNT-Pfeil

```mcfunction
execute at @e[type=arrow,nbt={inGround:true}] run summon tnt ~ ~ ~
```

#### Zerstörer Schneeball

```mcfunction
execute at @e[type=snowball] run fill ~-2 ~-2 ~-2 ~2 ~2 ~2 air
```

### Command Ketten

#### TNT-Pfeil eine Explosion

```mcfunction
tag @e[type=arrow,nbt={inGround:true}] add toExplode
execute at @e[tag=toExplode] run summon tnt ~ ~ ~
kill @e[tag=toExplode]
```

#### Hüpfender Block

```mcfunction
execute as @e[type=minecraft:falling_block,nbt={BlockState:{Name:"minecraft:gravel"}}] at @s unless block ~ ~-0.5 ~ air run tag @s add toHop
execute at @e[tag=toHop] run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:gravel"},Time:1,Motion:[0.0d,0.6d,0.3d]}
kill @e[tag=toHop]
```

### Command Ketten die Setup brauchen

#### Trichter für Spieler

Tichter teleportieren Spieler in die Richtung in die sie zeigen.\
Kessel teleportieren Spieler nach oben. Ähnlich wie in diesem [Video](https://www.youtube.com/watch?v=aVSvQ1347Q0)

Initial:

```mcfunction
scoreboard objectives add playerhoppersneak minecraft.custom:minecraft.sneak_time
```

Dauernd:

```mcfunction
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ hopper[facing=down] run tp @s ~ ~-0.9 ~
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ hopper[facing=west] run tp @s ~-1 ~0.1 ~
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ hopper[facing=east] run tp @s ~1 ~0.1 ~
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ hopper[facing=north] run tp @s ~ ~0.1 ~-1
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ hopper[facing=south] run tp @s ~ ~0.1 ~1
execute as @a[scores={playerhoppersneak=0}] at @s if block ~ ~ ~ minecraft:cauldron run tp @s ~ ~1.8 ~
scoreboard players set @a playerhoppersneak 0
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbuch.kidslab.de/minecraft/coole-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
