Skip to content

Commit 16eceff

Browse files
Update wiki (#2)
* Update optimising.md * Update questions.md * Update angermob.md * Update angermob.md * Update angermob.md * Update amountitems.md * Update angermob.md * Update angermob.md * Update areas.md * Update blockinvert.md * Update angermob.md * Update fakeplayer.md * Update blockdelay.md * Update blockdelay.md * Update blockdelay.md * Update randomnumber.md * Update randomnumber.md * Update randomnumber.md * Update randomnumber.md * Update areas.md * Update blockdelay.md * Update blockdelay.md * Update highestscore.md * Update linkentity.md * Update lookat.md * Update amountitems.md * Update fakeplayer.md * Update fakeplayer.md * Update debugging.md * Update debugging.md * Update debugging.md * Update optimising.md * Update optimising.md * Update debugging.md * Update numplayers.md * Update numplayers.md * Update playerdeaths.md * Update questions.md * Update angermob.md * Update blockdelay.md * Update functionconditions.md * Update changeofscore.md Remove bedrock edition method as it is the same as Java, review in the wiki https://minecraft.wiki/w/Commands/execute#ifunlessscore but it should work in bedrock * Update playerjoin.md * Update debugging.md #2 (comment) * Update findsamescoreentity.md * Update runonce.md * Update lookat.md * Update lookat.md * Update debugging.md * Create shop.md Has missing information about behavior packs (if there is another way of doing it with them not showed in this tutorial) in bedrock edition as I am not experienced with them. * Update shop.md Fixed a typo * Update blockdelay.md * Update blockinvert.md * Update commandcontext.md * Update blockdelay.md * Update debugging.md * Update questions.md * Update questions.md “Detect when a mob died” not starting in a new line and continuing in the last one * Update questions.md * Update customcrafting.md Updated to bedrock edition * Update customcrafting.md * Update customcrafting.md * Create hostilefriendly.md Not sure about bedrock syntax, https://minecraft.wiki/w/Commands/replaceitem * Update debugging.md #2 (comment) * Update optimising.md #2 (comment) * Update debugging.md #2 (comment) * Update debugging.md #2 (comment) * Update debugging.md * Update lookat.md #2 (comment) * Update debugging.md * Update changeofscore.md #2 (comment) * Update angermob.md #2 (comment) * Update questions.md #2 (comment) * Update questions.md #2 (comment) * Update blockdelay.md * Update shop.md #2 (comment) * Update shop.md #2 (comment) * Update shop.md * Update questions.md * Update blockdelay.md #2 (comment) * Update shop.md Typo * Update shop.md #2 (comment) * Update shop.md * Update hostilefriendly.md * Update shop.md #2 (comment) * Update shop.md #2 (comment) * Update shop.md * Update debugging.md * Update debugging.md * Update resources.md Why misode was not in advancements generators? * Update playerjoin.md #2 (comment) * Update linkentity.md * Update numplayers.md * Update randomnumber.md * Update numplayers.md * Update storeinventory.md * Update itemclick.md * Update debugging.md Common problems, such as not adding limit or /data selecting more than one targets * Update debugging.md More to debug… * Update optimising.md A update for @n * Update storeinventory.md Curse of vanishing warning * Update shop.md * Update debugging.md Edition world gen requires to leave the world * Update debugging.md * Update questions.md Added link to submit GitHub pull request * Update bcresources.md Each line was not starting in a new one * Update compasstoplayer.md Note about players spawning in world spawn * Update debugging.md Scores are not saved in playerdata * Update modifyinventory.md Just added a link, why not * Update randomnumber.md * Update playerjoin.md Added a simple explanation * Update shop.md Information and notez * Update debugging.md CommandBlockModificationLimit * Update debugging.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update storeinventory.md #2 (comment) * Update playerjoin.md #2 (comment) * Update randomnumber.md #2 (comment) * Update storeinventory.md #2 (comment) * Update shop.md #2 (comment) * Update playerjoin.md #2 (comment) * Update findsamescoreentity.md * Update debugging.md Updated image of how to enable game log * Update hostilefriendly.md I just tested, it does not work in bedrock * Create npc.md After experimenting with NPCs, I wrote information about creating chained dialogues and add commands... as @GalSergey said in #2 (comment) * Update amountitems.md Fixed bedrock command * Update changeofscore.md It is the same in bedrock * Update compasstoplayer.md Missing dot at the end of a sentence * Update customitemtag.md Bedrock * Update detectitem.md Using color codes with a tag to identify it * Update findsamescoreentity.md The java version is the same as the bedrock one (without predicates) * Update hostilefriendly.md Typo * Update itemclick.md * Update linkentity.md It works for bedrock too * Update movetoscore.md It works in bedrock binary tp * Update shop.md Added related article * Update blockinvert.md * Update heighttest.md Added explanation that negative numbers are supported using `dy ` to detect any player below * Update heighttest.md * Update debugging.md https://www.minecraft.net/en-us/article/minecraft-snapshot-24w21a Changes in directory names * Update debugging.md I am not sure if it should be in this category… * Update shop.md Missing “?” * Update questions.md Added NPC * Update optimising.md * Update storeinventory.md #2 (comment) * Update storeinventory.md It could be done in multiplayer, but it will require multiple chests * Update storeinventory.md Bedrock /replaceitem does not allow using “from”, so it’s not possible to do this directly * Update playerkills.md Added the advancement * Update raycast.md user Reddit link * Update raycast.md It’s better to have the title at the top, in my opinion * Update playerkills.md Removed extra line * Update shop.md Added how to use multiple items as a price * Update runonce.md Added bedrock support * Update runonce.md * Update randomnumber.md Added example to bedrock edition * Update customitemtag.md Source https://www.reddit.com/r/MinecraftCommands/comments/1d241x6/comment/l5y5cms/?utm_source=share&utm_medium=web2x&context=3 * Update customitemtag.md * Update detectitem.md Source: https://www.reddit.com/r/MinecraftCommands/comments/1d241x6/comment/l5y5cms/?utm_source=share&utm_medium=web2x&context=3 * Update commandcontext.md Added NPC command context * Update compasstoplayer.md * Update customitemtag.md Im not expecting bedrock people scroll trought a lot of text only to find their solution * Update storeinventory.md /replaceitem does not accept “with” * Update randomnumber.md Addedca note, saying the information is outdated * Update optimising.md Falling blocks or entities does not show how to do it, just added the example * Update optimising.md * Update questions.md Summarized * Update blockinvert.md Remove extra * * Update npc.md Added link to the minecraft.wiki NPC * Update numplayers.md Im not sure if they changed that, * Update areas.md * Update giveitembedrock.md Added an exaplanation that tells that you can use wprld editors to get illegal enchantemtents * Update giveitembedrock.md /structure did not was `/structure ` * Update commandcontext.md Added a missing soace between npc and the text that says bedrock edition only * Update debugging.md * Update debugging.md Even more to debug * Update lookat.md Missing `) ` * Update movetoscore.md Typo * Update playerdeaths.md Typo * Update playerjoin.md * Update movetoscore.md @s wasn’t in inline code * Update movetoscore.md If you are in a slab and store in the scoreboard Pos[1] and then tp to that score, you will be inside the slab, and if there is no block below, you will clip * Update movetoscore.md * Update shop.md Missing tellraw * Update shop.md Adde related * Update optimising.md #2 (comment) * Update blockdelay.md #2 (comment) * Update blockdelay.md #2 (comment) * Update blockdelay.md #2 (comment) * Update changeofscore.md #2 (comment) * Update commandcontext.md #2 (comment) * Update commandcontext.md #2 (comment), and did the same for the NPC * Update compasstoplayer.md #2 (comment) * Update customitemtag.md #2 (comment) * Update customitemtag.md #2 (comment) * Update detectitem.md #2 (comment) * Update detectitem.md #2 (comment) * Update findsamescoreentity.md #2 (comment) * Update functionconditions.md #2 (comment) * Update heighttest.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) And #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update hostilefriendly.md #2 (comment) * Update lookat.md #2 (comment) * Update lookat.md #2 (comment) * Update npc.md #2 (comment) * Update playerjoin.md #2 (comment) * Update playerjoin.md #2 (comment) * Update randomnumber.md #2 (comment) * Update functionconditions.md #2 (comment) * Update npc.md #2 (comment) * Update npc.md #2 (comment), I think it’s better inline code * Update lookat.md #2 (comment) * Update npc.md #2 (comment) * Update questions.md #2 (comment) #2 (comment) * Update functionconditions.md #2 (comment) * Update playerkills.md #2 (comment) * Update randomnumber.md #2 (comment) * Update runonce.md #2 (comment) * Update shop.md #2 (comment) * Update debugging.md #2 (comment) * Update commandcontext.md #2 (comment) * Update shop.md #2 (comment) * Update shop.md #2 (comment) * Update questions/shop.md #2 (comment) Co-authored-by: Lukas Scheuerle <[email protected]> * Update shop.md #2 (comment) * Update shop.md #2 (comment) * Update shop.md #2 (comment) * Update runonce.md #2 (comment) * Update playerkills.md #2 (comment) * Update blockdelay.md #2 (comment) * Update optimising.md #2 (comment) * Update optimising.md #2 (comment) * Update blockdelay.md #2 (comment) * Update optimising.md #2 (comment) * Update blockdelay.md By global, I mean optimizing a command and make it run half the speed for example * Update shop.md * Update shop.md #2 (comment) * Update shop.md #2 (comment) #2 (comment) * Update runonce.md 33ad867#r142661214 * Update shop.md * Update runonce.md https://github.com/MinecraftCommands/wiki/pull/2/files#r1624255977 @GalSergey it is ok now? and @Plagiatus review this (as I just added it) * Update debugging.md Missing inline code * Update questions/customitemtag.md Co-authored-by: Lukas Scheuerle <[email protected]> * Update questions/detectitem.md Co-authored-by: Lukas Scheuerle <[email protected]> * Update questions/functionconditions.md Co-authored-by: Lukas Scheuerle <[email protected]> --------- Co-authored-by: Lukas Scheuerle <[email protected]>
1 parent 7c0be15 commit 16eceff

39 files changed

+1126
-199
lines changed

bcresources.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,48 @@ Submit a pull request or create a GitHub issue if you've found a useful tool or
1212

1313
### Utilities
1414

15-
[NBT Editor](http://universalminecrafteditor.com/software/UniversalMC_setup.exe?fdl=1) (Universal Minecraft Editor)
16-
[NBT Editor](http://www.mcctoolchest.com/Download) (MCC Tool Chest)
15+
* [NBT Editor](http://universalminecrafteditor.com/software/UniversalMC_setup.exe?fdl=1) (Universal Minecraft Editor)
16+
* [NBT Editor](http://www.mcctoolchest.com/Download) (MCC Tool Chest)
1717

1818
### Resources
19-
[Level format](https://minecraft.wiki/Bedrock_Edition_level_format) (Wiki)
19+
* [Level format](https://minecraft.wiki/Bedrock_Edition_level_format) (Wiki)
2020

2121
## World editing
2222

2323
### Utilities
2424

25-
[MCEdit Unified](http://www.mcedit-unified.net)
26-
[MCEdit filter collection](http://www.brightmoore.net/mcedit-filters-1) (Adrian Brightmoore) ^[Designed for Java, not all will work in Bedrock]
27-
[MCEdit filter collection](http://elemanser.com/filters.html) (Texelelf) ^[Designed for Java, not all will work in Bedrock]
28-
[MCEdit filter collection specifically for Bedrock](https://github.com/PathwayStudios/Bedrock_MCEdit_Filters/blob/master/CreateShops_README.md) (PathwayStudios)
29-
[Java to Pocket Edition World converter](https://www.planetminecraft.com/mod/anvil-to-leveldb-converter-java-to-pocket-edition/) (Empire92)
25+
* [MCEdit Unified](http://www.mcedit-unified.net)
26+
* [MCEdit filter collection](http://www.brightmoore.net/mcedit-filters-1) (Adrian Brightmoore) ^[Designed for Java, not all will work in Bedrock]
27+
* [MCEdit filter collection](http://elemanser.com/filters.html) (Texelelf) ^[Designed for Java, not all will work in Bedrock]
28+
* [MCEdit filter collection specifically for Bedrock](https://github.com/PathwayStudios/Bedrock_MCEdit_Filters/blob/master/CreateShops_README.md) (PathwayStudios)
29+
* [Java to Pocket Edition World converter](https://www.planetminecraft.com/mod/anvil-to-leveldb-converter-java-to-pocket-edition/) (Empire92)
3030

3131
## Resource packs
3232

3333
### Utilities
3434

35-
[Entity model creator](http://server.zofenia.de/blockbench/) (BlockBench)
36-
[Entity model creator](https://cubik.studio/) (Cubik) ^[Paid]
35+
* [Entity model creator](http://server.zofenia.de/blockbench/) (BlockBench)
36+
* [Entity model creator](https://cubik.studio/) (Cubik) ^[Paid]
3737

3838
### References
3939

40-
[Creating a resource pack guide](http://minecraft.wiki/Tutorials/Creating_resource_pack_add-ons) (Wiki)
41-
[Changing entity models guide](http://minecraft.wiki/Tutorials/Changing_Minecraft_entity_models) (Wiki)
42-
[Sounds list](https://minecraft.wiki/Sounds.json/Bedrock_Edition_values) (Wiki)
40+
* [Creating a resource pack guide](http://minecraft.wiki/Tutorials/Creating_resource_pack_add-ons) (Wiki)
41+
* [Changing entity models guide](http://minecraft.wiki/Tutorials/Changing_Minecraft_entity_models) (Wiki)
42+
* [Sounds list](https://minecraft.wiki/Sounds.json/Bedrock_Edition_values) (Wiki)
4343

4444
# Behavior packs
4545

4646
### References
4747

48-
[Creating a behavior pack guide](http://minecraft.wiki/Tutorials/Creating_behavior_packs) (Wiki)
49-
[Entity components for latest release](http://minecraft.wiki/Pocket_Edition_entity_components) (Wiki)
50-
[Entity components for latest beta](https://minecraft.wiki/Bedrock_Beta_Add-On_Documentation) (Wiki)
51-
[Loot table guide](http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-maps/mcpe-map-help-requests/2838965-custom-loot-tables-for-pe-win10) (Skylinerw)
52-
[UI format documentation](https://github.com/bleonard252/mc-uijson/wiki) (bleonard252)
48+
* [Creating a behavior pack guide](http://minecraft.wiki/Tutorials/Creating_behavior_packs) (Wiki)
49+
* [Entity components for latest release](http://minecraft.wiki/Pocket_Edition_entity_components) (Wiki)
50+
* [Entity components for latest beta](https://minecraft.wiki/Bedrock_Beta_Add-On_Documentation) (Wiki)
51+
* [Loot table guide](http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-maps/mcpe-map-help-requests/2838965-custom-loot-tables-for-pe-win10) (Skylinerw)
52+
* [UI format documentation](https://github.com/bleonard252/mc-uijson/wiki) (bleonard252)
5353

5454
# Commands
5555

5656
### References
5757

58-
[Commands list](http://minecraft.wiki/Commands) (Wiki)
59-
[Data values](https://minecraft.wiki/Bedrock_Edition_data_values) (Wiki)
58+
* [Commands list](http://minecraft.wiki/Commands) (Wiki)
59+
* [Data values](https://minecraft.wiki/Bedrock_Edition_data_values) (Wiki)

debugging.md

Lines changed: 95 additions & 24 deletions
Large diffs are not rendered by default.

optimising.md

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
For example, if you have a function or chain of command blocks that control an arena, you probably only need those running when someone is actually in the arena.
88

9-
Consider a "branching" structure of checks. You could start with just `/testfor @a`. If and only if that succeeds you'd run checks to do with players, such as whether a player is holding *any* special item. If a player is holding any special item, run checks to see what kind of special item it is. Only then off of these last checks would you run the commands that make that item work.
9+
Consider a "branching" structure of checks. You could start with just `/execute if entity @a` (Or `/testfor @a` in pre-1.13). If and only if that succeeds you'd run checks to do with players, such as whether a player is holding *any* special item. If a player is holding any special item, run checks to see what kind of special item it is. Only then off of these last checks would you run the commands that make that item work.
1010

1111
**Don't** achieve this by repeatedly using `/execute` as a condition (e.g: `/execute as @a[tag=holdItem] ...`) while still having all the blocks/commands running, as this will still need to repeatedly evaluate the selector for each command. Instead, you want the commands to not be running at all if the previous check failed.
1212

@@ -23,46 +23,26 @@ You can alternatively use the following commands to activate an impulse command
2323

2424
These commands should be conditional blocks on the chain that performs the condition test. Your setup might look [something like this](http://i.imgur.com/vyhnmTH.png).
2525

26-
**Functions** make this even easier and more efficient. You can run a different function only if a selector succeeds/fails, for example:
26+
**Functions** make this even easier and more efficient. You can run a different function only if a condition (for example, if a specified selector exist) succeeds/fails, for example:
2727

2828
# pre-1.13 syntax
2929
function code:arena_events if @a[tag=in_arena]
3030
function code:check_winner unless @a[tag=winner]
3131
# 1.13+ syntax
3232
execute if entity @a[tag=in_arena] run function code:arena_events
3333
execute unless entity @a[tag=winner] run function code:check_winner
34+
# 1.13+ syntax (block condition)
35+
execute if block 0 60 0 air run function code:missing_block
36+
execute unless block 0 90 0 grass_block run function code:place_block
3437

35-
## Slow down your commands
36-
37-
Not everything needs to be running at 20Hz. If you can run some commands at 10Hz instead, you've halved the impact those commands were having. In Bedrock you can just add a delay to a repeating commandblock into the block directly, in Java you need some workaround.
38-
39-
An easy trick with command blocks to make a clock run at half its speed is the following command:
40-
41-
# pre-1.13 syntax
42-
testforblock ~ ~ ~ repeating_command_block * {SuccessCount:0}
43-
# 1.13+ syntax
44-
execute if block ~ ~ ~ repeating_command_block{SuccessCount:0}
45-
46-
Set up [like this](http://i.imgur.com/OULTCZx.png), the command will alternate between succeeding (as it failed last time so has `SuccessCount:0`) and failing (as it succeeded last time so has `SuccessCount:1`), and the conditional repeating block coming off of it will thus activate every other tick.
38+
In 1.13+ you can check more things apart from selectors with [`execute if/unless`](https://minecraft.wiki/w/Commands/execute#Condition_subcommands)
4739

48-
These cause no block updates and require no entities or scoreboard objectives, but are limited to halving the speed of the first block.
49-
50-
More flexible and commonly used are scoreboard timers. One command continually increments a value, another tests when this value reaches a certain number, then the value is reset and a chain of commands is activated.
51-
52-
[Here's an example setup image.](http://i.imgur.com/fGyA294.png)
53-
54-
These cause no block updates and require no entities, but will require an objective, and a new fake player for each timer. Scoreboard timers can also be used in functions.
55-
56-
Other methods such as a falling block clock exist and can be convenient, but cause block updates, lighting updates, and requires an entity.
57-
58-
**Functions** can be even easier to run on slower speeds, as the `schedule` command allows you to run functions after a certain amount of time has passed. You can use this for functions to schedule themselves to essentially create a slower clock.
59-
60-
`code/slow_function.mcfunction`
40+
## Slow down your commands
41+
Not everything needs to be running at 20Hz. If you can run some commands at 10Hz instead, you've halved the impact those commands were having.
6142

62-
schedule function slow_function 10t
63-
say this will run twice per second
43+
In Bedrock you can just add a delay to a repeating commandblock into the block directly, in Java you need some workaround that you can find in the questions ["How to add delay to a command"](/wiki/questions/blockdelay)
6444

65-
you just need to start the function at some point (e.g. in the `#minecraft:load` function tag) and it will run at a slower speed.
45+
If you are using command blocks it is recomended to use the `SuccessCount` method to make them at half speed but if you are using datapacks, use schedule functions.
6646

6747
## Avoid chunk updates
6848

@@ -106,7 +86,7 @@ Selectors are used a lot in commands. To make sure you're not causing extra work
10686

10787
Your main aim here is to narrow down the list as much as possible before getting to the expensive distance-sorting/shuffling and especially the super expensive NBT checks. You shouldn't however unnecessarily check arguments that won't narrow down the list before distance-sorting/shuffling. For example, don't check `@e[type=zombie,tag=IsUndeadMob]` if all zombies will have that tag. You shouldn't make your selector imprecise so that it applies to more entities than it needs to, either.
10888

109-
`nbt` is the least efficient target selector, as it has to do a lot of converting and comparing, and as such should be avoided at (almost) all costs, or at least limited to the absolute minimum required.
89+
`nbt` is the least efficient target selector, as it has to do a lot of converting and comparing, and as such should be avoided at (almost) all costs, or at least limited to the absolute minimum required. [Predicates](https://minecraft.wiki/w/Predicate), in the other hand, can archive the same causing less performance impact only when not using NBT checks but built-in checks. If using NBT checks it actually performs worse.
11090

11191
`@s` is the most efficient selector, directly grabbing the command sender. See the section on **function-specific optimisations** for how you can make use of it to cut down on use of other selectors.
11292

@@ -122,9 +102,9 @@ Using armor stands as markers? Strongly consider switching to area effect clouds
122102

123103
summon area_effect_cloud ~ ~ ~ {Duration:2147483647}
124104

125-
These won't show up to spectators, which is a bonus if you don't want spectators to see your markers. If you want to see them for debugging purposes, turn on hitboxes (`F3 + B`). Armor stands should only be used where necessary, such as displaying an item or using `Motion`.
105+
These won't show up to spectators, which is a bonus if you don't want spectators to see your markers. If you want to see them for debugging purposes, turn on hitboxes (`F3 + B`). Armor stands should only be used where necessary, such as displaying an item (In pre-1.19.4, as you can use item displays in newer versions) or using `Motion`.
126106

127-
[Marker entities](https://minecraft.wiki/wiki/Marker) on the other hand are impossible to see, as they aren't even sent to the client, so you'd need to resort to other options to debug them. This however means that they have a competitive advantage when it comes to performance and should be used as a marker over the other options wherever possible.
107+
[Marker entities](https://minecraft.wiki/wiki/Marker) on the other hand are impossible to see, as they aren't even sent to the client (unless using [a mod](https://modrinth.com/mod/visiblebarriers), that needs to be on the server as well), so you'd need to resort to other options to debug them. This however means that they have a competitive advantage when it comes to performance and should be used as a marker over the other options wherever possible.
128108
Additionally they can store any kind of NBT data in their `data` NBT component (though storing abritrary data is probably better stored in the `storage` anyways).
129109

130110
Remember from the previous section that selectors work by getting a list of all loaded entities, then narrowing that down. This means that extra entities increase the workload of every selector in your commands. In some cases, you could be able to use static coordinates rather than executing off of a marker entity.
@@ -157,6 +137,6 @@ This means that instead of evaluating `@e[tag=blah]` many times, it is only eval
157137

158138
## More in-depth optimization
159139

160-
/u/Wooden_chest created an in-depth analysis of a lot of small things that can improve your performance, like what order to put your execute subcommands into or that depending on the circumstance it might actually be faster to copy NBT you want to test to the storage first before testing it instead of testing it on the entity/player directly.
140+
[/u/Wooden_chest](https://www.reddit.com/user/Wooden_chest/) created an in-depth analysis of a lot of small things that can improve your performance, like what order to put your execute subcommands into or that depending on the circumstance it might actually be faster to copy NBT you want to test to the storage first before testing it instead of testing it on the entity/player directly.
161141

162-
Read their full post here: https://www.reddit.com/r/MinecraftCommands/comments/w4vjs3/whenever_i_create_datapacks_i_sometimes_do/
142+
Read their full post here: https://www.reddit.com/r/MinecraftCommands/comments/w4vjs3/whenever_i_create_datapacks_i_sometimes_do/

questions.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
Because in 1.19.50, the [new execute syntax](https://learn.microsoft.com/en-us/minecraft/creator/documents/commandsnewexecute) became mandatory, so you'll need to switch to that. See also [this information on bedrock.dev](https://wiki.bedrock.dev/commands/new-execute.html).
66

7+
## Why is my give command broken (java)?
8+
In 1.20.5 a new system for storing item data has been introduced to Java Edition in [Snapshot 24w09a](https://www.minecraft.net/en-us/article/minecraft-snapshot-24w09a).
9+
Anything relating to items (such as /give, /item or loot tables) have a different format now.
10+
The gist of it is this: Unstructured NBT data attached to stacks of items (tag field) has been replaced with structured 'components' that go in [] and are comma separated.
11+
For example: /give @p diamond_pickaxe[damage=10,custom_model_data=7]
12+
For a list of how item components are structured, see [this article on the minecraft.wiki](https://minecraft.wiki/w/Item_format/1.20.5).
13+
714
## How do I...
815

916
### Items
@@ -14,7 +21,8 @@ Because in 1.19.50, the [new execute syntax](https://learn.microsoft.com/en-us/m
1421
[Detect rightclick or leftclick (on an item)?](/wiki/questions/itemclick)
1522
[Give a special item (Bedrock)?](/wiki/questions/giveitembedrock)
1623
[Change an item while it's in the players inventory?](/wiki/questions/modifyinventory)
17-
[Do custom crafting](/wiki/questions/customcrafting)
24+
[Do custom crafting?](/wiki/questions/customcrafting)
25+
[Make a shop? / Buy items?](/wiki/questions/shop)
1826

1927
### Scores
2028

@@ -25,7 +33,7 @@ Because in 1.19.50, the [new execute syntax](https://learn.microsoft.com/en-us/m
2533
[Summon/Teleport an entity/player at/to a position defined in a score?](/wiki/questions/movetoscore)
2634
[Detect a change in score?](/wiki/questions/changeofscore)
2735
[Link an entity to another entity through scoreboards?](/wiki/questions/linkentity)
28-
[Find the player / entity with the highest score?](/wiki/questions/highestscore/)
36+
[Find the player / entity with the highest / lowest score?](/wiki/questions/highestscore)
2937

3038
### Players
3139

@@ -50,8 +58,10 @@ Because in 1.19.50, the [new execute syntax](https://learn.microsoft.com/en-us/m
5058
[Make a scoreboard ID system?](/wiki/questions/linkentity)
5159
[Make one mob attack another mob/player?](/wiki/questions/angermob)
5260
[Do raycasting?](/wiki/questions/raycast)
53-
[Make a circle (of blocks / entities)?](/wiki/questions/makecircle/)
54-
[Detect when a mob has died](/wiki/questions/mobdeaths)
61+
[Make a circle (of blocks / entities)?](/wiki/questions/makecircle)
62+
[Detect when a mob has died](/wiki/questions/mobdeaths)
63+
[Make hostile mobs friendly / dissable PvP](/wiki/questions/hostilefriendly)
64+
[Setup, configure and add multiple dialogues to NPCs?](/wiki/questions/npc)
5565

5666
## What is...
5767

@@ -67,4 +77,4 @@ Because in 1.19.50, the [new execute syntax](https://learn.microsoft.com/en-us/m
6777

6878
## Still needed articles
6979

70-
*Found something that should be added? Maybe even want to contribute an article? Submit a pull request or create a GitHub issue.*
80+
*Found something that should be added? Maybe even want to contribute an article? Submit a pull request or create a GitHub issue [here](https://github.com/MinecraftCommands/wiki).*

questions/amountitems.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ Here are some examples for this:
5252

5353
## Bedrock
5454

55-
In the **1.18.20 beta** they added the [`hasitem`](https://minecraft.wiki/wiki/Target_selectors#Selecting_targets_by_items) target selector, which allows you to check for specific amounts (as [ranges](/wiki/questions/range)) of items in entities inventories. Below is an example, check the link above for more information.
55+
In the **1.18.20 beta** they added the [`hasitem`](https://minecraft.wiki/wiki/Target_selectors#Selecting_targets_by_items) target selector, which allows you to check for specific amounts (as [ranges](/wiki/questions/range)) of items in entities inventories. Below is an example (using 1.19.50 execute), check the link above for more information.
5656

57-
execute @a[hasitem={item:apple,quantity=5..}] ~~~ run say I have 5 or more apples in my inventory
57+
execute as @a[hasitem={item=apple,quantity=5..}] run say I have 5 or more apples in my inventory

0 commit comments

Comments
 (0)