minecraft.wiki-mirror/wiki_backup/processor list.txt

127 lines
7.7 KiB
Text

{{Exclusive|java}}
A '''processor list''' is used to transform blocks of a [[structure template]] during generation. They contain a list of processors. Processor lists are configured using [[JSON]] files stored within a [[data pack]] in the folder {{cd|data/<namespace>/worldgen/processor_list}}.
== JSON format ==
A processor list can be a list, or an object that contains a list.
A list:
<div class="treeview">
* {{nbt|list}}: A list of processors.
** {{nbt|compound}}: A processor object (see below)
</div>
Or an object:
<div class="treeview">
* {{nbt|compound}}: An object of processor list.
** {{nbt|list|processors}}: A list of processors.
*** {{nbt|compound}}: A processor object (see below)
</div>
== Processors ==
===rule===
Replaces blocks with custom rules
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:rule}}
** {{Nbt|list|rules}}: (Required, but can be empty) A list of rules. Only the first rule that all conditions are met takes effect. This is decided anew for each block.
*** {{Nbt|compound}}: A rule.
**** {{Nbt|compound|position_predicate}}: (Optional, defaults to an "always_true" test) The test to apply to the distance from the structure start to this block.
***** {{Nbt inherit/pos rule test}}
**** {{Nbt|compound|input_predicate}}: The test to apply to the block placed by the structure.
***** {{Nbt inherit/rule test}}
**** {{Nbt|compound|location_predicate}}: The test to apply to the block in the world that is replaced by the structure.
***** {{Nbt inherit/rule test}}
**** {{Nbt|compound|output_state}}: The block that is placed when all conditions are met. Omitting block states use default values (e.g. the replacement of stairs with stairs without changing states need 40 rules to check for all facing combinations).
***** {{nbt inherit/block state}}
**** {{Nbt|compound|block_entity_modifier}}: (optional) Modifies nbt data of the block entity if all conditions are met.
***** {{Nbt|string|type}}: Can be {{cd|minecraft:append_loot}}(Appends <code>LootTable</code> field and <code>LootTableSeed</code> field to the block entity. The <code>LootTableSeed</code> uses a random number seeded by the block position.), {{cd|minecraft:append_static}}(Merges specified data into the block entity.), {{cd|minecraft:clear}}(Resets any existing fields on the block entity.) or {{cd|minecraft:passthrough}}(Do nothing).
*****; If {{cd|type}} is {{cd|minecraft:append_loot}}, additional field is as follows<nowiki>:</nowiki>
***** {{Nbt|string|loot_table}}: The resource location of a loot table.
*****; If {{cd|type}} is {{cd|minecraft:append_static}}, additional field is as follows<nowiki>:</nowiki>
***** {{Nbt|compound|data}}: The nbt data to be merged into the block entity. Needs to be in JSON form, see [[NBT format#JSON and NBT]].
</div>
===block_rot===
Randomly removes blocks. The removed blocks are not replaced by air, but keep the old blocks before the structure being generated
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:block_rot}}
** {{Nbt|float|integrity}}: The probability of randomly removing blocks in the structure. Value between 0 and 1.
** {{Nbt|string}}{{nbt|list|rottable_blocks}}: (optional) Blocks that can be removed. A block ID or a block tag, or a list of block IDs.
</div>
===block_age===
Makes blocks aged. A stone, stone bricks, or cracked stone bricks block has a chance of 0.5 to be replaced with one of cracked stone bricks, stone brick stairs, mossy stone bricks, and mossy stone brick stairs. All variants of stairs have a 0.5 chance to become one of stone slab, stone brick slab, mossy stone brick stairs, and mossy stone brick slab. All variants of slabs and walls may remain unchanged or become mossy stone brick variants. Obsidian also has a 0.15 chance to be replaced with crying obsidian.
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:block_age}}
** {{Nbt|float|mossiness}}: Values below 0.0 is treated as 0.0; values above 1.0 is treated as 1.0. The probability of using mossy variants when making a block aged.
</div>
===block_ignore===
Removes specified blocks. The removed blocks are not replaced by air, but keep the old blocks before the structure being generated.
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:block_ignore}}
** {{Nbt|list|blocks}}: (Required, but can be empty) IDs of blocks to ignore. Specifying block states has no effect.
*** {{Nbt|compound}}: A block.
**** {{nbt inherit/block state}}
</div>
===gravity===
Change the Y-level of blocks' positions to fit the terrain like a village road. Note that this is not used to make floating gravity blocks fall down. This processor is hardcoded to be used on a structure template if its "projection" field in its [[template pool]] is "terrain_matching"
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:gravity}}
** {{Nbt|string|heightmap}}: (optional, defaults to WORLD_SURFACE_WG) Must be one of <code>"WORLD_SURFACE_WG"</code>(if not during world generation, fallbacks to <code>WORLD_SURFACE</code>), <code>"WORLD_SURFACE"</code>, <code>"OCEAN_FLOOR_WG"</code>(if not during world generation, fallbacks to <code>OCEAN_FLOOR</code>), <code>"OCEAN_FLOOR"</code>, <code>"MOTION_BLOCKING"</code>, or <code>"MOTION_BLOCKING_NO_LEAVES"</code>.
** {{Nbt|int|offset}}: (optional, defaults to 0) The offset relative to the terrain. For example: 0 is to place the structure on the ground, -1 is to sink one block into the ground. When this processor is used on a structure template by hardcoding (when the template's "projection" field in its [[template pool]] is "terrain_matching"), {{Nbt|int|offset}} is -1.
</div>
===protected_blocks===
Specifies which blocks in the world cannot be overridden by this structure
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:protected_blocks}}
** {{Nbt|string|value}}: A block tag with <code>#</code>.
</div>
===blackstone_replace===
Replaces all stone-variant blocks with blackstone variants and all iron bars with chains.
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:blackstone_replace}}
</div>
===jigsaw_replacement===
Replaces [[jigsaw block]]s with the specified final state. This processor is hardcoded to be used unless generated in the jigsaw block GUI.
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:jigsaw_replacement}}
</div>
===lava_submerged_block===
Blocks with incomplete outline shapes cannot override the lava in the world
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:lava_submerged_block}}
</div>
===capped===
Applies a processor to some random blocks instead of applying it to all blocks.
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:capped}}
** {{Nbt|int}}{{Nbt|compound|value}}: The number of blocks on which the processor is applied. Must be greater than 0. If it is greater than or equal to the total number of blocks in the structure template, all blocks are processed as if the processer is not capped.
*** {{nbt inherit/int provider}}
** {{Nbt|compound|delegate}}: Another processor object
</div>
===nop===
Does nothing
<div class="treeview">
* {{Nbt|compound}}: A processor object
** {{Nbt|string|processor_type}}: {{cd|minecraft:nop}}
</div>
== External links ==
* [https://misode.github.io/worldgen/processor-list/ Processor list Generator on misode.github.io]
== Navigation ==
{{Navbox Java Edition technical|datapack}}
[[fr:Liste de processeurs]]
[[pt:Lista de processadores]]