Minecraft:Block transformer definition: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 31: | Line 31: | ||
== Vanilla usage == | == Vanilla usage == | ||
Vanilla uses block transformers for tools that strip, scrape, unwax, till or flatten blocks. {{ | 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" | {| 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 | ! {{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" | | | rowspan="3" | | ||
* {{ItemLink|Wooden Axe}} | |||
* {{ItemLink|Golden Axe}} | * {{ItemLink|Golden Axe}} | ||
* {{ItemLink|Stone Axe}} | * {{ItemLink|Stone Axe}} | ||
| Line 42: | Line 43: | ||
* {{ItemLink|Iron Axe}} | * {{ItemLink|Iron Axe}} | ||
* {{ItemLink|Diamond Axe}} | * {{ItemLink|Diamond Axe}} | ||
* {{ItemLink|Netherite 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> | | 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}} | | {{BlockLink|Wood}}, {{BlockLink|hyphae}}, {{BlockLink|logs}}, {{BlockLink|stems}}, and {{BlockLink|block of bamboo}} | ||
| Line 63: | Line 64: | ||
|- | |- | ||
| rowspan="3" | | | rowspan="3" | | ||
* {{ItemLink|Wooden Hoe}} | |||
*{{ItemLink|Wooden Hoe}} | * {{ItemLink|Golden Hoe}} | ||
*{{ItemLink|Golden Hoe}} | * {{ItemLink|Stone Hoe}} | ||
*{{ItemLink|Stone Hoe}} | * {{ItemLink|Copper Hoe}} | ||
*{{ItemLink|Copper Hoe}} | * {{ItemLink|Iron Hoe}} | ||
*{{ItemLink|Iron Hoe}} | * {{ItemLink|Diamond Hoe}} | ||
*{{ItemLink|Diamond Hoe}} | * {{ItemLink|Netherite 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> | | 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 | | Blocks in {{Tag link|block|turns_into_farmland}} tag with {{Tag link|block|air}} directly above | ||
| Line 90: | Line 89: | ||
| {{nbt|string|loot}}: {{cd|minecraft:till/rooted_dirt}}<br>{{nbt|string|drop_strategy}}: {{cd|clicked_face}} | | {{nbt|string|loot}}: {{cd|minecraft:till/rooted_dirt}}<br>{{nbt|string|drop_strategy}}: {{cd|clicked_face}} | ||
|- | |- | ||
| | |||
* {{ItemLink|Wooden Shovel}} | * {{ItemLink|Wooden Shovel}} | ||
* {{ItemLink|Golden Shovel}} | * {{ItemLink|Golden Shovel}} | ||
| Line 99: | Line 97: | ||
* {{ItemLink|Diamond Shovel}} | * {{ItemLink|Diamond Shovel}} | ||
* {{ItemLink|Netherite 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> | | {{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 | | Blocks in {{Tag link|block|turns_into_dirt_path}} tag with {{Tag link|block|air}} directly above | ||
Revision as of 11:05, 7 September 2026
Template:Exclusive Template:In development
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.
JSON Format
Block transformers are defined using the following format:
- Template:Nbt The root object.<section begin="json format" />
- Template:Nbt: The game iterates through this list until it finds an element whose Minecraft:block state provider returns a result.
- Template:Nbt: A single object in the list.
- Template:Nbt: A Minecraft:block state provider which provides the state for the transformed block. Only block state providers used in world generation are allowed.
- Template:NbtTemplate:Nbt: Optional. Template:Json ref to play upon successful transformation. Defaults to none.
- Template:Nbt: Optional. The particle to use for the interaction. Can be one of Template:Cd. Defaults to Template:Cd.
- Template:Nbt: Optional. Interacting with one of the specified faces will not transform the block.
- Template:Nbt: An element in the list. Can be one of Template:Cd.
- Template:Nbt: Optional. The Minecraft:loot table to use for dropping items upon successful transformation. If not present, no loot is dropped.
- Template:Nbt: Optional. Where in the block space the dropped loot should spawn. Can be either Template:Cd (loot spawns at the center of the block space) or Template:Cd (loot spawns at the center of the face interacted with). Defaults to Template:Cd.
- Template:Nbt: Optional. Whether the transformed block should attempt to update its state based on neighboring blocks after transformation. Defaults to Template:Cd.
- Template:Nbt: Optional. Configures how nearby blocks should be affected by the transformation. Can be either Template:Cd (only the targeted block is affected) or Template:Cd (if input and output blocks are both copper chests of any weathering state, waxed or unwaxed, this transformation will affect both sides of a double chest).
- Template:Nbt: Optional. Whether or not the item should be consumed upon successful transformation, if it is stackable and the player is in survival or adventure mode. Defaults to Template:Cd.
- Template:Nbt: 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 Template:Cd.<section end="json format" />
- Template:Nbt: A single object in the list.
- Template:Nbt: The game iterates through this list until it finds an element whose Minecraft:block state provider returns a result.
Vanilla usage
Vanilla uses block transformers for tools that strip, scrape, unwax, till or flatten blocks. Template:Nbt is always set to Template:Cd.
History
References
Template:Navbox Java Edition technical
Minecraft:de:Blockumwandler Minecraft:ja:ブロック変換器 Minecraft:zh:方块变换效果定义格式