Skip to content

Commit 3aafdbb

Browse files
authored
Merge pull request #79 from Datapack-Hub/mc-version-1_21_5
Mostly updated wiki to Minecraft 1.21.5
2 parents 70dbae3 + d1ae42c commit 3aafdbb

33 files changed

Lines changed: 209 additions & 85 deletions

File tree

src/routes/guide/adding-new-features/custom-items/crafting/+page.svx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Recipes for your Custom Items
33
description: "Learn how to make custom crafting recipes for custom items in Minecraft Datapacks."
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# Creating Recipes for your Custom Items
@@ -11,7 +11,7 @@ developing for. The first one is for the Minecraft version 1.20.5+ (Datapack for
1111
specified in the output with [item components](/wiki/concepts/item_components). The second method is for all version
1212
before 1.20.5.
1313

14-
## After 1.20.5
14+
## 1.20.5 and newer
1515

1616
This is the easier method of the two, only requiring you to put the item id and components into the recipe output.
1717

@@ -66,7 +66,7 @@ In the example, you can see that the result has a `"components"` field, where yo
6666
custom item should have. I can also recommend a useful site for generating recipes with specified components:
6767
https://misode.github.io/recipe/
6868

69-
## Before 1.20.5
69+
## 1.20.4 and below
7070

7171
**This part of the guide assumes that you already knowledge some basic commands and how crafting recipes and
7272
advancements work.**

src/routes/guide/adding-new-features/custom-items/intro/+page.svx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Recipes for your Custom Items
33
description: "Learn how to make custom items with Minecraft Java datapacks"
44
tags: beginner, guide, custom_items, item_components
5-
version: 1.21.4
5+
version: 1.21.5
66
---
77

88
# Creating Custom Items
@@ -15,7 +15,7 @@ In this guide we will create a custom edible item which can mine sand instantly
1515
## How do custom items work?
1616
Custom items are items with a unique set of item components to change their appearance and functionality. As of 1.21, we cannot create fully custom items - instead, we need to take an item which exists, and add, remove, or edit their item components to customise it.
1717

18-
Item components cannot cover every desired functionality. An example of this is doing something when the item is right clicked. We still have to use workarounds for this, such as giving the item a `food` component to make it edible, then detecting when a player starts eating it. You can read more about this in our [right click detection](/guide/right-click) guide.
18+
Item components cannot cover every desired functionality. An example of this is doing something when the item is right clicked. We still have to use workarounds for this, such as giving the item a `food` component to make it edible, then detecting when a player starts eating it. You can read more about this in our [right click detection](/guide/right-click) summary.
1919

2020
## Creating our custom item
2121
We are going to create a custom item with the following properties:
@@ -32,13 +32,14 @@ These are all the item components which we are going to use.
3232
| Property | Component needed | Our component |
3333
| - | - | - |
3434
| Mines sand very quickly | `minecraft:tool` is used to make items mine different blocks quickly | `[tool={default_mining_speed:1.5,damage_per_block:0,rules:[{blocks:"minecraft:sand",speed:100}]}]` |
35-
| Is edible, makes the player glow | `minecraft:food` makes items edible. We can also use it to specify an effect for the player to recieve. | `[food={nutrition:3,saturation:1,can_always_eat:true,effects:[{id:"minecraft:glowing",duration:100}]}]` |
35+
| Is edible, makes the player glow | `minecraft:consumable` makes items edible. We can also use it to specify an effect for the player to recieve. | `[consumable={on_consume_effects:[{type:"minecraft:apply_effects",effects:[{id:"minecraft:glowing",amplifier:1,duration:100}]}]}]` |
36+
| Gives the player saturation and nutrition stats on consumption | `minecraft:food` gives the player saturation and nutrition after consuming it. | `[food={nutrition:3,saturation:1,can_always_eat:true}]` |
3637
| Is called Sandy McDesertface | `minecraft:item_name` overrides our item name. | `[item_name="Sandy McDesertface"]` |
3738

3839
Combining all of these together, we can create a give command for our custom item:
3940
```mcfunction
40-
/give @s minecraft:stick[tool={default_mining_speed:1.5,damage_per_block:0,rules:[{blocks:"minecraft:sand",speed:100}]},food={nutrition:3,saturation:1,can_always_eat:true,effects:[{id:"minecraft:glowing",duration:100}]},item_name="Sandy McDesertface"]
41+
/give @s stick[tool={default_mining_speed:1.5,damage_per_block:0,rules:[{speed:100,blocks:"sand"}]},food={nutrition:3,saturation:1,can_always_eat:true},consumable={on_consume_effects:[{type:"minecraft:apply_effects",effects:[{id:"minecraft:glowing",amplifier:1,duration:100}]}]},item_name='"Sandy McDesertface"'] 1
4142
```
4243
:::info
4344
`minecraft:stick` can be any item you want. All custom items need to be based on an existing item. We do not yet have the functionality to create our own item IDs. However, we can make use of the `custom_model_data` (or `custom_model` in recent snapshots) component to change the model or texture of the item.
44-
:::
45+
:::

src/routes/guide/adding-new-features/jukebox-songs/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Adding Jukebox Songs
33
description: "Learn how to create custom music discs and custom jukebox songs with Minecraft datapacks"
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# How to add custom jukebox songs

src/routes/guide/adding-new-features/painting-variants/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Adding Paitings
33
description: "Learn how to add custom paitings to Minecraft just with a datapack and a resourcepack!"
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# How to add custom paintings

src/routes/guide/adding-new-features/smithing-trims/+page.svx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Adding Smithing Trims
33
description: "Learn how to add custom smithing trims patterns to Minecraft just with a datapack and a resourcepack!"
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# How to add custom Smithing Trims
@@ -28,15 +28,14 @@ going to call it `example_pattern.json`. Inside, we will put and configure these
2828
{
2929
"asset_id": "<namespace>:example_template",
3030
"description": "Example Trim",
31-
"template_item": "minecraft:diamond_block",
3231
"decal": false
3332
}
3433
```
3534

3635
This is a run-down of the fields in that file:
3736
- `description`: A text component to use as this trim's description name.
38-
- `template_item`: The item that represents the template item (E.g. the bolt armor trim used the `bolt_armor_trim_smithing_template` item).
3937
- `asset_id`: The resource location which is used in the resourcepack.
38+
- `decal`: Whether or not the pattern texture should be masked based on the underlying armor. Optional, defaults to false.
4039

4140
If you are not sure what to put in `asset_id`, don't worry, the resource pack part is going to focus on that!
4241

@@ -47,10 +46,13 @@ Now, we are going to add the recipe file into `data/<namespace>/recipe/`. You ca
4746
"type": "minecraft:smithing_trim",
4847
"addition": "#minecraft:trim_materials",
4948
"base": "#minecraft:trimmable_armor",
50-
"template": "minecraft:diamond_block"
49+
"template": "minecraft:diamond_block",
50+
"pattern": "<namespace>:example_template"
5151
}
5252
```
5353

54+
Here we have to specify the template item which is going to be used for the pattern, and the trim pattern ID itself.
55+
5456
### Finishing up with the resourcepack - Smithing Trim Pattern
5557

5658
To finish off, we'll need to add the actual definition for all the different colors and armor types. This can be done by changing the armor trim's atlas file. This file can be found in `assets/minecraft/atlases/armor_trims.json`. Please note that the exact spelling and the use of the Minecraft namespace is required here!
@@ -104,8 +106,8 @@ in-game. You will also need to leave and rejoin the world to update the datapack
104106
For this to work, you will need to leave and rejoin the world, just using the `/reload` command won't do the trick here!
105107
:::
106108

107-
## Adding a smithing trim color palette
108-
### Setting up the datapack - Smithing Trim Color Palette
109+
## Adding a smithing trim material
110+
### Setting up the datapack - Smithing Trim Material
109111

110112
For this example, we are going to add a new trim color palette. To start, we are going to create the main trim color palette file in the directory `data/<namespace>/trim_material/`.
111113
Once again, you can name the file whatever you want, but it has to be in the `.json` file format. For the purposes of this tutorial, we're
@@ -117,14 +119,12 @@ going to call it `matexample.json`. Inside, we will put and configure these sett
117119
"description": {
118120
"text": "Example Material",
119121
"color": "#00e09d"
120-
},
121-
"ingredient": "minecraft:barrier"
122+
}
122123
}
123124
```
124125

125126
This is a run-down of the fields in that file:
126127
- `description`: A text component to use as this trim's material description name.
127-
- `ingredient`: The item that represents the material.
128128
- `asset_name`: The resource location which is used in the resourcepack.
129129
- `override_armor_materials`: A list of optional armors which should have a different color palette. (E.g. Gold trim on gold armor has a darker color palette.)
130130

@@ -138,7 +138,13 @@ Next, we are going to add the `ingredient` item to the `#minecraft:trim_material
138138
}
139139
```
140140

141-
### Finishing up with the resourcepack - Smithing Trim Color Palette
141+
As of 1.21.5, every item you want to work as a trim material, needs to have the [`provides_trim_material`](https://minecraft.wiki/w/Data_component_format#provides_trim_material) item component. So to give ourselfs a barrier which provides our custom trim material, we can use this `/give` command:
142+
143+
```mcfunction
144+
/give @s barrier[provides_trim_material="<namespace>:matexample"] 1
145+
```
146+
147+
### Finishing up with the resourcepack - Smithing Trim Material
142148

143149
To finish off, we'll need to add the material definition in the resourcepack. This can be done by changing the armor trim's atlas file. This file can be found in `assets/minecraft/atlases/armor_trims.json`. Please note that the exact spelling and the use of the Minecraft namespace is required here!
144150

src/routes/guide/getting-started/+page.svx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: How to Make a Minecraft Datapack - Beginner's Guide
33
tags: guide, beginner, Minecraft, datapack, tutorial, step-by-step
44
description: Learn how to create a Minecraft datapack with our beginner's guide. This step-by-step tutorial will help you understand the basics of datapack creation, even if you have little coding knowledge. Start enhancing your Minecraft experience today!
5-
version: 1.21.4
5+
version: 1.21.5
66
---
77

88
<script lang="ts">
@@ -184,8 +184,8 @@ Now we've created a function which will run infinitely on a loop, we can move on
184184
ground.
185185

186186
As far as the game is concerned, an arrow is an **entity**, just like a pig, cow or zombie. Minecraft gives us a special
187-
way to **select** any types of entities with [target selectors](/concepts/target_selectors). Once we've selected an
188-
entity, we can use the [/execute](/command/execute) command to run a command as the entity.
187+
way to **select** any types of entities with [target selectors](/wiki/concepts/target-selectors). Once we've selected an
188+
entity, we can use the [/execute](/wiki/command/execute) command to run a command as the entity.
189189

190190
We can use these to select all arrows which are in the ground, and then run a command to make them explode (and then
191191
remove themselves).

src/routes/guide/mcfunction-vs-coding/+page.svx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: MCFunction vs Coding
33
description: "Learn the differences between using MCFunctions and traditional coding."
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# MCFunction vs Traditional Coding
@@ -15,12 +15,12 @@ trying to apply traditional coding logic to MCFunction.
1515

1616
MCFunction isn't like most programming languages, MCFunction uses scoreboards, storages and macros (1.20.2+) as their variables.
1717

18-
**Scoreboards** are like a table. They store a name and a value which you can then retrieve and modify later. You can use both entity names/UUIDs and "fake player"
18+
[Scoreboards](/wiki/nbt-scoreboards/scoreboards) are like a table. They store a name and a value which you can then retrieve and modify later. You can use both entity names/UUIDs and "fake player"
1919
names (names not associated with any player), allowing for easy combination of variables and entity scores. Scoreboards can only hold 32-bit integers and other data
2020
types (such as floats, doubles or strings) can not be stored this way.
2121

22-
[Storages](/wiki/nbt/storages) are a way of storing [NBT data](/wiki/nbt/nbt) without attaching it to an entity or block. Storages are stored globally per
23-
world and unlike scoreboards, dont need to be initialized beforehand. Unlike entity and block NBT, storages have no fixed structure, and can contain whichever
22+
[Storages](/wiki/nbt-scoreboards/nbt#nbt-storages) are a way of storing [NBT data](/wiki/nbt-scoreboards/nbt) without attaching it to an entity or block. Storages are stored globally per
23+
world and unlike scoreboards, don't need to be initialized beforehand. Unlike entity and block NBT, storages have no fixed structure, and can contain whichever
2424
arbitrary keys are added to it.
2525

2626
[Macros](/wiki/files/functions#macro-functions) are like fancy string templating, when a function is supplied with macros, it will go through the function file
@@ -62,7 +62,7 @@ data modify storage example:main other_number set from storage example:main numb
6262
data modify storage example:main compound.array append value 42
6363
```
6464

65-
(Get more info on storages on [the wiki page](/wiki/nbt/storages))
65+
(Get more info on storages on [the wiki page](/wiki/nbt-scoreboards/nbt#nbt-storages))
6666

6767
## Q: How do you loop in MCFunction?
6868

src/routes/guide/misc/raycasts/+page.svx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Raycasts
33
description: "Raycasting is when we shoot a line from the player's eyes in the direction they are looking. We use this to get what the player is looking at, and do something to it, such as spawning an explosion."
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# Raycasting
@@ -57,7 +57,7 @@ tag @s remove raycaster
5757

5858
In the raycast function, we just want to check if the function has hit an entity, and if not, run it again until it does, hits a wall, or reaches the raycasts limit, moving slightly each time.
5959

60-
The next step is a bit more complex. We execute a command as every entity that is not the caster and whose hitbox intersects with the current path of the raycast (using [virtual volumes](https://datapack.wiki/wiki/concepts/target_selectors#dxdydz-arguments)). The command will `return run <namespace>:hit` if the raycast hits an entity. The `return run` will stop the raycast from running further, and then will run the `hit` function as the entity it has hit.
60+
The next step is a bit more complex. We execute a command as every entity that is not the caster and whose hitbox intersects with the current path of the raycast (using [virtual volumes](https://datapack.wiki/wiki/concepts/target-selectors#dxdydz-arguments)). The command will `return run <namespace>:hit` if the raycast hits an entity. The `return run` will stop the raycast from running further, and then will run the `hit` function as the entity it has hit.
6161

6262
The last command checks if the raycast hit a wall. If it does, the raycast will end. If it doesn't, it will then check
6363
if the limit is reached, again ending if it is. Should the limit not be reached yet, it will move `0.1` blocks forward and

src/routes/guide/misc/slowcasts/+page.svx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Slowcast
33
description: "Like a raycast but in slow. Useful if simply using tp every tick skips over too much when making it fast."
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# Slowcasting
@@ -100,7 +100,7 @@ projectile has hit something on its way there.
100100
2. make some particles for the visuals (you could replace the particle command with another function call that does more
101101
complex stuff)
102102
3. execute a command as every entity _(excluding entities with the slowcast tag and players)_ whose hit box intersects
103-
with both [virtual volumes](https://datapack.wiki/wiki/concepts/target_selectors#dxdydz-arguments) run the hit
103+
with both [virtual volumes](https://datapack.wiki/wiki/concepts/target-selectors#dxdydz-arguments) run the hit
104104
function and kill the projectile.
105105
4. tp the projectile to the current position _(until now it only executed the command at this position but is still 0.1
106106
block further back)_

src/routes/guide/nbt-and-scores/array-iteration/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Array Iteration
33
description: This guide explains how to loop through an array's items in a Minecraft datapack
4-
version: 1.21.4
4+
version: 1.21.5
55
---
66

77
# Array Iteration

0 commit comments

Comments
 (0)