Skip to content

Commit

Permalink
Merge pull request #1001 from BedrockCommands/wiki
Browse files Browse the repository at this point in the history
Updated Command Pages
  • Loading branch information
zheaEvyline authored Feb 16, 2025
2 parents c94c924 + 04c2515 commit 75e03e1
Show file tree
Hide file tree
Showing 29 changed files with 674 additions and 736 deletions.
64 changes: 32 additions & 32 deletions docs/commands/block-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Max's Block Entity system using commands.

## Introduction

[Sourced By Bedrock Commands Community Discord](https://discord.gg/SYstTYx5G5)
[Sourced by the Bedrock Commands Community (BCC) Discord](https://discord.gg/SYstTYx5G5)

This method, developed by Reddit user [u/Maxed_Out10](https://www.reddit.com/user/Maxed_Out10/) allows you to create near-perfect entity replications of any Minecraft block using armor stands and some sequential `/playanimation` commands.

Expand Down Expand Up @@ -45,33 +45,33 @@ _To be typed in chat:_

:::tip

- `/replaceitem entity @e [name=Grumm] slot.weapon.offhand 0 <itemID>`
- `/replaceitem entity @e[name="Grumm"] slot.weapon.offhand 0 <itemID>`
- Instead of manually placing the desired block item in the armor stand's main-hand, use this command to place it in it's off-hand to prevent players from taking the item.

:::

## System

<CodeHeader>BP/functions/mbe/render.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/mbe/render.mcfunction</CodeHeader>

```yaml
## Align Arms
playanimation @e [type=armor_stand, name=Grumm] animation.armor_stand.entertain_pose null 0 "0" wiki:align.arms
playanimation @e[type=armor_stand,name="Grumm"] animation.armor_stand.entertain_pose null 0 "0" wiki:align.arms

## Mini Block Size
playanimation @e [type=armor_stand, name=Grumm] animation.player.move.arms.zombie null 0 "0" wiki:size.mini_block
playanimation @e[type=armor_stand,name="Grumm"] animation.player.move.arms.zombie null 0 "0" wiki:size.mini_block

## Full Block (optional)
### Size
playanimation @e [type=armor_stand, name=Grumm] animation.ghast.scale null 0 "0" wiki:size.full_block
playanimation @e[type=armor_stand,name="Grumm"] animation.ghast.scale null 0 "0" wiki:size.full_block
### Align
playanimation @e [type=armor_stand, name=Grumm] animation.fireworks_rocket.move null 0 "0" wiki:align.full_block
playanimation @e[type=armor_stand,name="Grumm"] animation.fireworks_rocket.move null 0 "0" wiki:align.full_block

## Freeze Armor Stand
execute as @e [type=armor_stand, name=Grumm] at @s run tp ~~~
execute as @e[type=armor_stand,name="Grumm"] at @s run tp ~~~

## Hide Armor Stand Body
effect @e [type=armor_stand, name=Grumm] invisibility infinite 1 true
effect @e[type=armor_stand,name="Grumm"] invisibility infinite 1 true
```

![commandBlockChain6](/assets/images/commands/commandBlockChain/6.png)
Expand Down Expand Up @@ -102,16 +102,16 @@ Using the same controller names above is not required. However, it can help avoi

```yaml
# Face north
/tp @e [type=armor_stand, name=Grumm, c=1] ~-1.1245 ~0.2260 ~-0.097 81
/tp @e[type=armor_stand,name="Grumm",c=1] ~-1.1245 ~0.2260 ~-0.097 81

# Face south
/tp @e [type=armor_stand, name=Grumm, c=1] ~1.1245 ~0.2260 ~0.097 260
/tp @e[type=armor_stand,name="Grumm",c=1] ~1.1245 ~0.2260 ~0.097 260

# Face east
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.097 ~0.2260 ~-1.1245 171
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.097 ~0.2260 ~-1.1245 171

# Face west
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.097 ~0.2260 ~1.1245 350
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.097 ~0.2260 ~1.1245 350
```

</Spoiler>
Expand All @@ -122,16 +122,16 @@ Using the same controller names above is not required. However, it can help avoi

```yaml
# Face north
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.417~-0.5 ~-0.035 81
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.417~-0.5 ~-0.035 81

# Face south
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.417 ~-0.5 ~0.035 260
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.417 ~-0.5 ~0.035 260

# Face east
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.035 ~-0.5 ~-0.417 171
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.035 ~-0.5 ~-0.417 171

# Face west
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.035 ~-0.5 ~0.417 350
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.035 ~-0.5 ~0.417 350
```

</Spoiler>
Expand All @@ -142,16 +142,16 @@ Using the same controller names above is not required. However, it can help avoi

```yaml
# Face north
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.097 ~0.2325 ~1.1245 350
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.097 ~0.2325 ~1.1245 350

# Face south
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.097 ~0.2325 ~-1.1245 171
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.097 ~0.2325 ~-1.1245 171

# Face east
/tp @e [type=armor_stand, name=Grumm, c=1] ~-1.1245 ~0.2325 ~-0.097 81
/tp @e[type=armor_stand,name="Grumm",c=1] ~-1.1245 ~0.2325 ~-0.097 81

# Face west
/tp @e [type=armor_stand, name=Grumm, c=1] ~1.1245 ~0.2325 ~0.097 260
/tp @e[type=armor_stand,name="Grumm",c=1] ~1.1245 ~0.2325 ~0.097 260
```

</Spoiler>
Expand All @@ -162,16 +162,16 @@ Using the same controller names above is not required. However, it can help avoi

```yaml
# Face north
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.097 ~0.2325 ~1.1245 350
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.097 ~0.2325 ~1.1245 350

# Face south
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.097 ~0.2325 ~-1.1245 171
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.097 ~0.2325 ~-1.1245 171

# Face east
/tp @e [type=armor_stand, name=Grumm, c=1] ~-1.1245 ~0.2325 ~-0.097 81
/tp @e[type=armor_stand,name="Grumm",c=1] ~-1.1245 ~0.2325 ~-0.097 81

# Face west
/tp @e [type=armor_stand, name=Grumm, c=1] ~1.1245 ~0.2325 ~0.097 260
/tp @e[type=armor_stand,name="Grumm",c=1] ~1.1245 ~0.2325 ~0.097 260
```

</Spoiler>
Expand All @@ -182,16 +182,16 @@ Using the same controller names above is not required. However, it can help avoi

```yaml
# Face north
/tp @e [type=armor_stand, name=Grumm, c=1] ~-1.1245 ~0.484 ~-0.097 81
/tp @e[type=armor_stand,name="Grumm",c=1] ~-1.1245 ~0.484 ~-0.097 81

# Face south
/tp @e [type=armor_stand, name=Grumm, c=1] ~1.1245 ~0.484 ~0.097 260
/tp @e[type=armor_stand,name="Grumm",c=1] ~1.1245 ~0.484 ~0.097 260

# Face east
/tp @e [type=armor_stand, name=Grumm, c=1] ~0.097 ~0.484 ~-1.1245 171
/tp @e[type=armor_stand,name="Grumm",c=1] ~0.097 ~0.484 ~-1.1245 171

# Face west
/tp @e [type=armor_stand, name=Grumm, c=1] ~-0.097 ~0.484 ~1.1245 350
/tp @e[type=armor_stand,name="Grumm",c=1] ~-0.097 ~0.484 ~1.1245 350
```

</Spoiler>
Expand All @@ -200,9 +200,9 @@ Using the same controller names above is not required. However, it can help avoi

1. To save, run:

- `/execute at @e [type=armor_stand, name=Grumm, c=1] run structure save wiki ~~~ ~~~ true disk false`
- `/execute at @e[type=armor_stand,name="Grumm",c=1] run structure save wiki:mbe ~~~ ~~~ true disk false`

2. To load, run:
- `/structure load wiki <to: x y z>`
- `/structure load wiki:mbe <to: x y z>`

> Note: Structure name `wiki` can be changed to your preference.
> Note: Structure name `wiki:mbe` can be changed to your preference.
2 changes: 1 addition & 1 deletion docs/commands/block-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Learn how to use block states in commands.

## Introduction

[Sourced by Bedrock Commands Community Discord](https://discord.gg/SYstTYx5G5)
[Sourced by the Bedrock Commands Community (BCC) Discord](https://discord.gg/SYstTYx5G5)

Block States, also known as Block Properties, define how blocks appear or behave, including attributes like direction, color, variant, or power state. These are extensively used in commands such as `/clone`, `/execute`, `/fill`, `/setblock`, and `/testforblock`.

Expand Down
78 changes: 39 additions & 39 deletions docs/commands/comparing-scores.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,57 @@ description: Learn to test for targets of matching scores / targets with the hig

## Introduction

[Sourced By Bedrock Commands Community Discord](https://discord.gg/SYstTYx5G5)
[Sourced by the Bedrock Commands Community (BCC) Discord](https://discord.gg/SYstTYx5G5)

In this guide, you will learn how to test for targets of matching scores / targets with the highest or lowest score.

## Get Highest Score ( > )

**Commands:**

<CodeHeader>BP/functions/scoreboards/player/get_highest_score.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_highest_score.mcfunction</CodeHeader>

```yaml
## Get Highest Score
scoreboard players operation Highest <objective> > * <objective>
scoreboard players operation .Highest <objective> > * <objective>

## Your Commands Here (Example)
execute as <target> if score @s <objective> = Highest <objective> run <command>
execute as <target> if score @s <objective> = .Highest <objective> run <command>
```

![Chain of 2 Command Blocks](/assets/images/commands/commandBlockChain/2.png)

**Command 1:** This command compares the `Highest` score with every other tracked score in the specified objective, and if the `Highest` score is lesser than the one being compared to, then the `Highest` score will be assigned the value of that score. To illustrate:
**Command 1:** This command compares the `.Highest` score with every other tracked score in the specified objective, and if the `.Highest` score is lesser than the one being compared to, then the `.Highest` score will be assigned the value of that score. To illustrate:

| # | Player | Objective: `kills` | Comparison with `Highest` | `Highest` after comparison |
| # | Player | Objective: `wiki:kills` | Comparison with `.Highest` | `.Highest` after comparison |
| :-: | :----: | :----------------: | :-----------------------: | :------------------------: |
| 1 | Alex | 10 | `Highest > Alex` | `Highest = 10` |
| 2 | Kai | 5 | `Highest > Kai` | `Highest = 10` |
| 3 | Steve | 20 | `Highest > Alex` | `Highest = 20` |
| 1 | Alex | 10 | `.Highest > Alex` | `.Highest = 10` |
| 2 | Kai | 5 | `.Highest > Kai` | `.Highest = 10` |
| 3 | Steve | 20 | `.Highest > Alex` | `.Highest = 20` |

_No change when `Highest` score is compared to player 2 after player 1 (since 10 is already greater than 5)._
_No change when `.Highest` score is compared to player 2 after player 1 (since 10 is already greater than 5)._

:::info NOTE:

Wildcard (`*`) compares with all tracked scores — that includes offline players. To compare with only online players or entities, use `@a` or `@e`.

:::

**Command 2:** This command can be modified or expanded. It allows you to run your desired command if the `<target>` score is equal to `Highest` score.
**Command 2:** This command can be modified or expanded. It allows you to run your desired command if the `<target>` score is equal to `.Highest` score.

- Note: Use `@p` or `@e [c=1]` in place of `<target>` if you want to limit your selection to only one.
- Note: Use `@p` or `@e[c=1]` in place of `<target>` if you want to limit your selection to only one.

**Example:**

<CodeHeader>BP/functions/scoreboards/player/get_highest_score/kills.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_highest_score/kills.mcfunction</CodeHeader>

```yaml
## Get Highest Score
scoreboard players operation Highest kills > * kills
scoreboard players operation .Highest wiki:kills > * wiki:kills

## Tag Players with the Most Kills
tag @a remove topKills
execute as @a if score @s kills = Highest kills run tag @s add topKills
tag @a remove wiki:top_kills
execute as @a if score @s wiki:kills = .Highest wiki:kills run tag @s add wiki:top_kills
```

![Chain of 3 Command Blocks](/assets/images/commands/commandBlockChain/3.png)
Expand All @@ -68,51 +68,51 @@ execute as @a if score @s kills = Highest kills run tag @s add topKills

**Commands:**

<CodeHeader>BP/functions/scoreboards/player/get_lowest_score.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_lowest_score.mcfunction</CodeHeader>

```yaml
## Get Lowest Score
scoreboard players operation Lowest <objective> < * <objective>
scoreboard players operation .Lowest <objective> < * <objective>

## Your Commands Here
execute as <target> if score @s <objective> = Lowest <objective> run <command>
execute as <target> if score @s <objective> = .Lowest <objective> run <command>
```

![Chain of 2 Command Blocks](/assets/images/commands/commandBlockChain/2.png)

**Command 1:** This command compares the `Lowest` score with every other tracked score in the specified objective, and if the `Lowest` score is greater than the one being compared to, then the `Lowest` score will be assigned the value of that score. To illustrate:
**Command 1:** This command compares the `.Lowest` score with every other tracked score in the specified objective, and if the `.Lowest` score is greater than the one being compared to, then the `.Lowest` score will be assigned the value of that score. To illustrate:

| # | Player | Objective: `blocks_travelled` | Comparison with `Lowest` | `Lowest` after comparison |
| # | Player | Objective: `wiki:blocks_travelled` | Comparison with `.Lowest` | `.Lowest` after comparison |
| :-: | :----: | :---------------------------: | :----------------------: | :-----------------------: |
| 1 | Alex | 100 | `Lowest < Alex` | `Lowest = 100` |
| 2 | Kai | 50 | `Lowest < Kai` | `Lowest = 50` |
| 3 | Steve | 200 | `Lowest < Alex` | `Lowest = 50` |
| 1 | Alex | 100 | `.Lowest < Alex` | `.Lowest = 100` |
| 2 | Kai | 50 | `.Lowest < Kai` | `.Lowest = 50` |
| 3 | Steve | 200 | `.Lowest < Alex` | `.Lowest = 50` |

_No change when `Lowest` score is compared to player 3 after player 2 (since 50 is already less than 200)._
_No change when `.Lowest` score is compared to player 3 after player 2 (since 50 is already less than 200)._

:::info NOTE:

Wildcard (`*`) compares with all tracked scores — that includes offline players. To compare with only online players or entities, use `@a` or `@e`.

:::

**Command 2:** This command can be modified or expanded. It allows you to run your desired command if the `<target>` score is equal to `Lowest` score.
**Command 2:** This command can be modified or expanded. It allows you to run your desired command if the `<target>` score is equal to `.Lowest` score.

- Note: Use `@p` or `@e [c=1]` in place of `<target>` if you want to limit your selection to only one.
- Note: Use `@p` or `@e[c=1]` in place of `<target>` if you want to limit your selection to only one.

**Example:**

<CodeHeader>
BP/functions/scoreboards/player/get_lowest_score/distance_travelled.mcfunction
BP/functions/wiki/scoreboard/players/get_lowest_score/blocks_travelled.mcfunction
</CodeHeader>

```yaml
## Get Lowest Score
scoreboard players operation Lowest distance_travelled < * distance_travelled
scoreboard players operation .Lowest wiki:blocks_travelled < * wiki:blocks_travelled

## Tag Players with the Least Distance Travelled
tag @a remove eliminate
execute as @a if score @s distance_travelled = Lowest distance_travelled run tag @s add eliminate
tag @a remove wiki:eliminated
execute as @a if score @s wiki:blocks_travelled = .Lowest wiki:blocks_travelled run tag @s add wiki:eliminated
```

![Chain of 3 Command Blocks](/assets/images/commands/commandBlockChain/3.png)
Expand All @@ -123,17 +123,17 @@ This command compares the executing target's score with other selected targets.

**Command:**

<CodeHeader>BP/functions/scoreboards/player/get_matching_score.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_matching_score.mcfunction</CodeHeader>

```yaml
execute as @a at @s at @a [rm=0.01] if score @s <objective> = @p <objective> run say @s and @p have matching scores!
execute as @a at @s at @a[rm=0.01] if score @s <objective> = @p <objective> run say @s and @p have matching scores!
```

![One Repeating Command Block](/assets/images/commands/commandBlockChain/1.png)

:::info NOTE:

In the `<command>` (where `/say` is used as an example), `@s` refers to the executing entity or player (the target), and `@p` or `@e [c=1]` refers to the entity or player being compared with.
In the `<command>` (where `/say` is used as an example), `@s` refers to the executing entity or player (the target), and `@p` or `@e[c=1]` refers to the entity or player being compared with.
:::

**Visualisation:**
Expand All @@ -142,25 +142,25 @@ In the `<command>` (where `/say` is used as an example), `@s` refers to the exec

**Example 1:** Teleport pet to owner if farther than 6 blocks:

<CodeHeader>BP/functions/scoreboards/player/get_matching_score/pet.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_matching_score/pet.mcfunction</CodeHeader>

```yaml
## Teleport to Owner
execute as @e [tag=pet] at @s at @a [rm=7] if score @s id = @p id run tp @s @p
execute as @e[tag=pet] at @s at @a[rm=7] if score @s wiki:id = @p wiki:id run tp @s @p
```

![One Repeating Command Block](/assets/images/commands/commandBlockChain/1.png)

**Example 2:** Set plot owner to Creative mode and others to Adventure mode:

<CodeHeader>BP/functions/scoreboards/player/get_matching_score/plot.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/scoreboard/players/get_matching_score/plot.mcfunction</CodeHeader>

```yaml
## Set Owners to Creative Mode
execute as @e [tag=plot] at @s at @a [r=16] if score @s id = @p id run gamemode c @p [m=!c]
execute as @e[tag=plot] at @s at @a[r=16] if score @s wiki:id = @p wiki:id run gamemode c @p[m=!c]

## Set Non-Owners to Adventure Mode
execute as @e [tag=plot] at @s at @a [r=16] unless score @s id = @p id run gamemode a @p [m=!a]
execute as @e[tag=plot] at @s at @a[r=16] unless score @s wiki:id = @p wiki:id run gamemode a @p[m=!a]
```

![Chain of 2 Command Blocks](/assets/images/commands/commandBlockChain/2.png)
10 changes: 5 additions & 5 deletions docs/commands/custom-crafting.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ To complete the setup, place down one final dropper where you want players to be

## System

<CodeHeader>BP/functions/custom_crafting.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/custom_crafting.mcfunction</CodeHeader>

```yaml
## If Recipe Matches Crafter: Clone Recipe Output to Crafter
execute if blocks <recipe> <recipe> <crafter> masked run clone <recipe_out> <recipe_output> <crafter>
execute if blocks <recipe> <recipe> <crafter> masked run clone <recipe_output> <recipe_output> <crafter>
```
![commandBlockChain1](/assets/images/commands/commandBlockChain/1.png)

Expand All @@ -74,11 +74,11 @@ For convenience, you may download the .mcstructure sample shared by @TwigYT:

You may add a playsound command to slightly enhance the crafting experience like so:

<CodeHeader>BP/functions/custom_crafting.mcfunction</CodeHeader>
<CodeHeader>BP/functions/wiki/custom_crafting.mcfunction</CodeHeader>

```yaml
## Play Sound Upon Crafting (optional)
execute if blocks <recipe> <recipe> <crafter> masked positioned <crafter> run playsound smithing_table.use @a [r=7]
## If Recipe Matches Crafter: Play Sound Upon Crafting (optional)
execute if blocks <recipe> <recipe> <crafter> masked positioned <crafter> run playsound smithing_table.use @a[r=7]
## If Recipe Matches Crafter: Clone Recipe Output to Crafter
execute if blocks <recipe> <recipe> <crafter> masked run clone <recipe_out> <recipe_output> <crafter>
```
Expand Down
Loading

0 comments on commit 75e03e1

Please sign in to comment.