Skip to content

Commit

Permalink
Merge pull request #928 from Bedrock-OSS/blocks-and-items/1.21.40
Browse files Browse the repository at this point in the history
Update Blocks and Items Sections to v1.21.40
  • Loading branch information
QuazChick authored Oct 22, 2024
2 parents 12df2c2 + f9c0dfa commit 5d07915
Show file tree
Hide file tree
Showing 39 changed files with 370 additions and 198 deletions.
4 changes: 2 additions & 2 deletions docs/blocks/applying-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mentions:
description: This tutorial aims to show how to apply status effects to entities as long as these entities stand on the block.
---

::: tip FORMAT & MIN ENGINE VERSION `1.21.20`
::: tip FORMAT & MIN ENGINE VERSION `1.21.40`
This tutorial assumes a basic understanding of blocks, including [block states](/blocks/block-states).
Check out the [blocks guide](/blocks/blocks-intro) before starting.
:::
Expand Down Expand Up @@ -142,7 +142,7 @@ And done! The code above will trigger the desired status effect as long as the e

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:wither_block",
Expand Down
28 changes: 25 additions & 3 deletions docs/blocks/block-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ mentions:
- QuazChick
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
Using the latest format version when creating custom blocks provides access to fresh features and improvements. The wiki aims to share up-to-date information about custom blocks, and currently targets format version `1.21.20`.
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
Using the latest format version when creating custom blocks provides access to fresh features and improvements. The wiki aims to share up-to-date information about custom blocks, and currently targets format version `1.21.40`.
:::
:::danger OVERRIDING COMPONENTS
Only one instance of each component can be active at once. Duplicate components will be overridden by the latest [permutations](/blocks/block-permutations) entry.
Expand All @@ -35,7 +35,7 @@ Block components are used to change how your block appears and functions in the

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:lamp",
Expand Down Expand Up @@ -519,6 +519,28 @@ A BlockDescriptor is an object that allows you to reference a block (or multiple

See [this](/blocks/block-tags) page for a list of vanilla tags and relevant blocks.

### Redstone Conductivity

Defines a block's ability to conduct redstone power.

_Released from experiment `Upcoming Creator Features` for format versions 1.21.40 and higher._

Type: Object

- `redstone_conductor`: Boolean
- Determines whether this block conducts direct redstone power.
- `allows_wire_to_step_down`: Boolean
- Determines whether redstone wire can travel down the side of this block.

<CodeHeader>minecraft:block > components</CodeHeader>

```json
"minecraft:redstone_conductivity": {
"redstone_conductor": true,
"allows_wire_to_step_down": false
}
```

### Selection Box

Defines the area of the block that is selected by the player's cursor. If set to true, default values are used. If set to false, this block is not selectable by the player's cursor. If this component is omitted, default values are used.
Expand Down
2 changes: 1 addition & 1 deletion docs/blocks/block-culling.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Culling rules are added in your resource pack's "block_culling" folder and appea

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block_culling_rules": {
"description": {
"identifier": "wiki:lamp_culling" // Identifier to be referenced in block JSON geometry component.
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/block-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ mentions:
- BlazeDrake
---

:::tip FORMAT VERSION `1.21.20`
Using the latest format version when creating custom blocks provides access to fresh features and improvements. The wiki aims to share up-to-date information about custom blocks, and currently targets format version `1.21.20`.
:::tip FORMAT VERSION `1.21.40`
Using the latest format version when creating custom blocks provides access to fresh features and improvements. The wiki aims to share up-to-date information about custom blocks, and currently targets format version `1.21.40`.
:::

## Registering Custom Components
Expand Down
77 changes: 77 additions & 0 deletions docs/blocks/block-items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Block Items
description: Learn about the items that represent blocks in places like your inventory.
category: General
tags:
- experimental
mentions:
- QuazChick
---

## Automatic Block Items

When you hold a block in your hand, what you're really holding is an item that places the block. When a custom block is registered to the game, Minecraft also automatically registers a new item to represent that block in the inventory.

This item uses the menu category and display name defined by the block, but no other components of the auto-block-item can be modified.
In order to apply other components, such as a 2D icon for your block, you'll need to replace the block's item with your own.

## Replacing Block Items

:::warning FORMAT VERSION 1.21.40 (EXPERIMENTAL)
Replacing block items requires the `Upcoming Creator Features` experiment to be enabled.
:::

In order to replace a block item, you will need to create a new item JSON file that has the same identifier as the block.

Your new item will also need the [block placer](/items/item-components#block-placer) component which will allow the item to place the block.
The block placer component will also give the item the 3D appearance of the block by default, however this can be overriden with the [icon](/items/item-components#icon) component to display a 2D sprite.

### Custom Flower Example

One example of a situation where replacing the block item is necessary is with flower blocks, which should display as an icon in item form rather than being 3D.

<CodeHeader>BP/blocks/daffodil.json</CodeHeader>

```json
{
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:daffodil"
},
"components": {
"minecraft:geometry": "minecraft:geometry.cross",
"minecraft:material_instances": {
"*": {
"texture": "daffodil",
"render_method": "alpha_test"
}
}
}
}
}
```

<CodeHeader>BP/items/daffodil.json</CodeHeader>

```json
{
"format_version": "1.21.40",
"minecraft:item": {
"description": {
"identifier": "wiki:daffodil", // Same as the block's ID
"menu_category": {
"category": "nature",
"group": "itemGroup.name.flower"
}
},
"components": {
"minecraft:icon": "daffodil",
"minecraft:block_placer": {
"block": "wiki:daffodil",
"replace_block_item": true
}
}
}
}
```
2 changes: 1 addition & 1 deletion docs/blocks/block-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ If you have textures for your block defined in that file, make sure you migrate

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:paper_bag",
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/block-permutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mentions:
- SmokeyStack
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
Before you learn about block permutations, you should be confident with [block states](/blocks/block-states).

When working with block states, ensure that the `min_engine_version` in your pack manifest is `1.20.20` or higher.
Expand Down Expand Up @@ -61,7 +61,7 @@ _Released from experiment `Holiday Creator Features` for format versions 1.19.70

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_block",
Expand Down
2 changes: 1 addition & 1 deletion docs/blocks/block-sounds.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This property is used to determine general block sounds, such as the mining soun

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"wiki:custom_log": {
"sound": "wood" // Define sound here
}
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/block-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mentions:
- SmokeyStack
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
When working with block states, ensure that the `min_engine_version` in your pack manifest is `1.20.20` or higher.
:::

Expand All @@ -26,7 +26,7 @@ _Released from experiment `Holiday Creator Features` for format versions 1.19.70

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_block",
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/block-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Block tags can be applied in the same way as items - in the block's `components`

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:tree_stump",
Expand Down Expand Up @@ -63,7 +63,7 @@ Example of an item querying a block's tags:

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:item": {
"description": {
"identifier": "wiki:custom_pickaxe",
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/block-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mentions:
- SmokeyStack
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
Before you learn about block traits, you should be confident with [block states](/blocks/block-states).

When working with block states, ensure that the `min_engine_version` in your pack manifest is `1.20.20` or higher.
Expand All @@ -22,7 +22,7 @@ Block traits can be used to apply vanilla block states (such as direction) to yo

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_slab",
Expand Down
10 changes: 5 additions & 5 deletions docs/blocks/blocks-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mentions:
- QuazChick
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
This page discusses basic block features. You can learn more about other block components [here](/blocks/block-components).
:::
:::danger NOTE
Expand All @@ -49,7 +49,7 @@ Below is the **minimum** behavior-side code to get a custom block into the creat

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_block",
Expand Down Expand Up @@ -82,7 +82,7 @@ Let's configure our own functionality!

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_block",
Expand Down Expand Up @@ -134,7 +134,7 @@ If you'd like to apply a custom model, the [geometry](/blocks/block-components#g

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"wiki:custom_block": {
"textures": "custom_block", // This texture shortname should be defined in `terrain_texture.json`, as shown below
"sound": "grass"
Expand Down Expand Up @@ -215,7 +215,7 @@ The `blocks.json` entry would look like this:

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"wiki:compass_block": {
"textures": {
"down": "compass_block_down",
Expand Down
10 changes: 5 additions & 5 deletions docs/blocks/custom-crops.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mentions:
description: Re-creation of vanilla crops.
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
This tutorial assumes a good understanding of blocks and scripting.
Check out the [blocks guide](/blocks/blocks-intro), [block states](/blocks/block-states) and [block events](/blocks/block-events) before starting.
:::
Expand Down Expand Up @@ -51,7 +51,7 @@ This code example also includes the base components of our crop which will be ac

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_crop",
Expand Down Expand Up @@ -308,7 +308,7 @@ Here is the entire `wiki:custom_crop` file for reference.

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_crop",
Expand Down Expand Up @@ -547,7 +547,7 @@ Holding a crop block in your hand wouldn't look right, so we place the crop with

```json
{
"format_version": "1.21.10",
"format_version": "1.21.40",
"minecraft:item": {
"description": {
"identifier": "wiki:custom_seeds", // Make sure this is different from your crop's ID.
Expand All @@ -574,7 +574,7 @@ Your crop can't only drop seeds! Create a custom food using the template below.

```json
{
"format_version": "1.21.10",
"format_version": "1.21.40",
"minecraft:item": {
"description": {
"identifier": "wiki:custom_food", // Make sure this is different from your crop and seeds' ID.
Expand Down
6 changes: 3 additions & 3 deletions docs/blocks/custom-dirt.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mentions:
hidden: true
---

:::tip FORMAT & MIN ENGINE VERSION `1.21.20`
:::tip FORMAT & MIN ENGINE VERSION `1.21.40`
This tutorial assumes a good understanding of blocks.
Check out the [blocks guide](/blocks/blocks-intro), [block states](/blocks/block-states) and [block permutations](/blocks/block-permutations) before starting.
:::
Expand All @@ -36,7 +36,7 @@ Add the `minecraft:is_hoe` or `minecraft:is_shovel` item tags to any custom tool

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_dirt",
Expand Down Expand Up @@ -247,7 +247,7 @@ Here is the full `wiki:custom_farmland` json for reference.

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_farmland",
Expand Down
6 changes: 3 additions & 3 deletions docs/blocks/custom-fluids.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: Re-creation of vanilla fluids.
hidden: true
---

::: tip FORMAT & MIN ENGINE VERSION `1.21.20`
::: tip FORMAT & MIN ENGINE VERSION `1.21.40`
This tutorial assumes an advanced understanding of blocks and the execute command.
Check out the [blocks guide](/blocks/blocks-intro) before starting.
:::
Expand Down Expand Up @@ -59,7 +59,7 @@ Below is the code for a custom fluid. Copy and quick replace `custom_fluid` with

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_fluid",
Expand Down Expand Up @@ -257,7 +257,7 @@ To place your custom fluid you need a custom bucket item. Below is the JSON for

```json
{
"format_version": "1.21.20",
"format_version": "1.21.40",
"minecraft:item": {
"description": {
"identifier": "wiki:custom_fluid_bucket",
Expand Down
Loading

0 comments on commit 5d07915

Please sign in to comment.