wiki

Common Questions

Why is my execute command broken (bedrock)?

Because in 1.19.50, the new execute syntax became mandatory, so you’ll need to switch to that. See also this information on bedrock.dev.

Why is my give command broken (java)?

In 1.20.5, unstructured NBT for item stacks (tag field) was replaced with structured “components.” Learn more in this article.

How do I…

Items

Detect a specific item (in the Inventory, in the selected slot, on the ground)?
Give an item a custom tag to identify it by?
Select players with exactly X of a certain item?
Detect rightclick or leftclick (on an item)?
Give a special item (Bedrock)?
Change an item while it’s in the players inventory?
Do custom crafting?
Make a shop? / Buy items?

Scores

Generate a random number?
Store an NBT value to a score, and vice versa? (1.13+ only)
Check if a score is equal to, greater than, or less than another score?
Find an entity that has the same score as another entity?
Summon/Teleport an entity/player at/to a position defined in a score?
Detect a change in score?
Link an entity to another entity through scoreboards?
Find the player / entity with the highest / lowest score?

Players

Activate a command once when a player does something (e.g: enters an area)?
Do something on all players in certain area(s)?
Target a player above/below a certain Y level?
Detect when a player died?
Detect when a player kills an entity/other player?
Detect a player joining (for the first time)?
Store a players inventory (and give it back later)?
Detect a player looking at something (entity / position)?

Conditions

Do conditions with functions?
Do something if a command block wasn’t successful?
Check if there are exactly X players (or entities) matching a selector?

Entities

Do something (e.g: kill) to the entity I just found with /execute if entity (testfor)?
Make one mob attack another mob/player?
Summon an entity/projectile flying in the direction the player is looking?
Detect when a mob has died
Make hostile mobs friendly / disable PvP?
Setup, configure and add multiple dialogues to NPCs?

Misc

Add a delay to a command block?
Point a compass towards a player/location?
Make a scoreboard ID system?
Do raycasting?
Make a circle (of blocks / entities)?

What is…

a fake player?
a range? / those two dots ..?
command context?
escaping?

How do I… (1.12 and below only)

Select an entity with multiple scoreboard tags?

Still needed articles

Found something that should be added? Maybe even want to contribute an article? Submit a pull request or create a GitHub issue