Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Block transformer definition: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{exclusive|java}}
{{exclusive|java}}
{{in development|Java||26.3}}


A '''block transformer''' contains rules for transforming blocks into another blocks. They are used by the {{Data component link|block_transformer}} component to allow an item to transform blocks on use.
A '''block transformer''' contains rules for transforming blocks into other blocks. They are used by the {{Data component link|block_transformer}} component to allow an item to transform blocks on use.


== Definition ==
== Definition ==
Line 29: Line 28:
**** {{nbt|int|item_damage_per_use}}: Optional. How much [[Minecraft:durability]] the item loses upon successful transformation, if it is not stackable and the player is in survival or adventure mode. Defaults to {{cd|1}}.<section end="json format" />
**** {{nbt|int|item_damage_per_use}}: Optional. How much [[Minecraft:durability]] the item loses upon successful transformation, if it is not stackable and the player is in survival or adventure mode. Defaults to {{cd|1}}.<section end="json format" />
</div>
</div>
== Vanilla usage ==
Vanilla uses block transformers for tools that strip, scrape, unwax, till or flatten blocks. {{nbt|int|item_damage_per_use}} is always set to {{cd|1}}.
{| class="wikitable"
! {{Tooltip|Items|Items with default data component}} !! {{Tooltip|ID|Block transformer JSON name}} !! {{Tooltip|Blocks affected| block_state_provider.rules.if_true}} !! {{Tooltip|Result|block_state_provider.rules.then}} !! Sound !! Particle !! Additional properties
|-
| rowspan="3" |
* {{ItemLink|Wooden Axe}}
* {{ItemLink|Golden Axe}}
* {{ItemLink|Stone Axe}}
* {{ItemLink|Copper Axe}}
* {{ItemLink|Iron Axe}}
* {{ItemLink|Diamond Axe}}
* {{ItemLink|Netherite Axe}}
| rowspan="3" | {{cd|axe}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/block_transformer/axe.json block_transformer/axe − misode.mcmeta]</ref>
| {{BlockLink|Wood}}, {{BlockLink|hyphae}}, {{BlockLink|logs}}, {{BlockLink|stems}}, and {{BlockLink|block of bamboo}}
| Converts to the matching [[Minecraft:stripped]] variant, copy properties.
| {{cd|item.axe.strip}}
| None
|-
| Any unwaxed oxidized state of [[Minecraft:copper]] blocks: {{BlockLink|block of copper}}, {{BlockLink|cut copper}}, {{BlockLink|chiseled copper}}, {{BlockLink|cut copper slab}}, {{BlockLink|cut copper stairs}}, {{BlockLink|copper trapdoor}}, {{BlockLink|copper bars}}, {{BlockLink|copper grate}}, {{BlockLink|copper bulb}}, {{BlockLink|copper lantern}}, {{BlockLink|copper golem statue}}, {{BlockLink|lightning rod}}, {{BlockLink|copper chain}}, {{BlockLink|copper chest}}, and {{BlockLink|copper door}}
| Reduces the [[Minecraft:oxidation]] stage by one (oxidized → weathered → exposed → unoxidized), copy properties.
| {{cd|item.axe.scrape}}
| {{cd|scrape}}
| rowspan="2" |
{{nbt|bool|update_from_neighbors}}: {{cd|false}} for doors and chests
<br>{{nbt|string|transform_type}}: {{cd|copper_chest}} for chests
|-
| Waxed variant of any block listed above (all oxidation stages, including unoxidized)
| Converts to the matching unwaxed variant, copy properties.
| {{cd|item.axe.wax_off}}
| {{cd|wax_off}}
|-
| rowspan="3" |
* {{ItemLink|Wooden Hoe}}
* {{ItemLink|Golden Hoe}}
* {{ItemLink|Stone Hoe}}
* {{ItemLink|Copper Hoe}}
* {{ItemLink|Iron Hoe}}
* {{ItemLink|Diamond Hoe}}
* {{ItemLink|Netherite Hoe}}
| rowspan="3" | {{cd|hoe}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/block_transformer/hoe.json block_transformer/hoe − misode.mcmeta]</ref>
| Blocks in {{Tag link|block|turns_into_farmland}} tag with {{Tag link|block|air}} directly above
| {{BlockLink|Farmland}}
| {{cd|item.hoe.till}}
| None
| {{nbt|list|disallowed_faces}}: {{cd|[down]}}
|-
| {{BlockLink|Coarse Dirt}} with {{Tag link|block|air}} directly above
| {{BlockLink|Dirt}}
| {{cd|item.hoe.till}}
| None
|{{nbt|list|disallowed_faces}}: {{cd|[down]}}
|-
| {{BlockLink|Rooted Dirt}}
| {{BlockLink|Dirt}}
| {{cd|item.hoe.till}}
| None
| {{nbt|string|loot}}: {{cd|minecraft:till/rooted_dirt}}<br>{{nbt|string|drop_strategy}}: {{cd|clicked_face}}
|-
|
* {{ItemLink|Wooden Shovel}}
* {{ItemLink|Golden Shovel}}
* {{ItemLink|Stone Shovel}}
* {{ItemLink|Copper Shovel}}
* {{ItemLink|Iron Shovel}}
* {{ItemLink|Diamond Shovel}}
* {{ItemLink|Netherite Shovel}}
| {{cd|shovel}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/block_transformer/shovel.json block_transformer/shovel − misode.mcmeta]</ref>
| Blocks in {{Tag link|block|turns_into_dirt_path}} tag with {{Tag link|block|air}} directly above
| {{BlockLink|Dirt Path}}
| {{cd|item.shovel.flatten}}
| None
| {{nbt|list|disallowed_faces}}: {{cd|[down]}}
|}


== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{HistoryLine|upcoming java}}
|{{HistoryLine|java}}
|{{HistoryLine||26.3|dev=snap10|Added {{cd|minecraft:block_transformer}} registry containing rules for transforming blocks into another blocks.}}
|{{HistoryLine||26.3|dev=snap10|Added {{cd|minecraft:block_transformer}} registry containing rules for transforming blocks into another blocks.}}
}}
}}
== References ==
{{reflist}}


== Navigation ==
== Navigation ==

Latest revision as of 11:04, 16 October 2026

Template:Exclusive

A block transformer contains rules for transforming blocks into other blocks. They are used by the Template:Data component link component to allow an item to transform blocks on use.

Definition

Block transformers can be defined in Minecraft:data packs, as part of the directory structure below.

Template:Data pack directory

JSON Format

Block transformers are defined using the following format:

Vanilla usage

Vanilla uses block transformers for tools that strip, scrape, unwax, till or flatten blocks. Template:Nbt is always set to Template:Cd.

Template:Tooltip Template:Tooltip Template:Tooltip Template:Tooltip Sound Particle Additional properties
Template:Cd<ref>block_transformer/axe − misode.mcmeta</ref> Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, and Template:BlockLink Converts to the matching Minecraft:stripped variant, copy properties. Template:Cd None
Any unwaxed oxidized state of Minecraft:copper blocks: Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, Template:BlockLink, and Template:BlockLink Reduces the Minecraft:oxidation stage by one (oxidized → weathered → exposed → unoxidized), copy properties. Template:Cd Template:Cd

Template:Nbt: Template:Cd for doors and chests
Template:Nbt: Template:Cd for chests

Waxed variant of any block listed above (all oxidation stages, including unoxidized) Converts to the matching unwaxed variant, copy properties. Template:Cd Template:Cd
Template:Cd<ref>block_transformer/hoe − misode.mcmeta</ref> Blocks in Template:Tag link tag with Template:Tag link directly above Template:BlockLink Template:Cd None Template:Nbt: Template:Cd
Template:BlockLink with Template:Tag link directly above Template:BlockLink Template:Cd None Template:Nbt: Template:Cd
Template:BlockLink Template:BlockLink Template:Cd None Template:Nbt: Template:Cd
Template:Nbt: Template:Cd
Template:Cd<ref>block_transformer/shovel − misode.mcmeta</ref> Blocks in Template:Tag link tag with Template:Tag link directly above Template:BlockLink Template:Cd None Template:Nbt: Template:Cd

History

Template:HistoryTable

References

Template:Reflist

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Blockumwandler Minecraft:ja:ブロック変換器 Minecraft:zh:方块变换效果定义格式