-
Notifications
You must be signed in to change notification settings - Fork 17
Block Requirement
Block Requirement is used to check/place/replace/break/destroy some blocks nearby the machine.
This requirement is available in both input
and output
modes.
The Requirement type of Block Requirement is : "custommachinery:block"
.
The Block Requirement have 4 mandatory properties and 6 optional properties.
Type
"type": "custommachinery:block"
Mode
Define when the requirement will be processed.
-
input
The requirement will be processed at the start of the crafting process. -
output
The requirement will be processed at the end of the crafting process.
"mode": "input"
The requirement will be processed at the start of the crafting process.
Action
Define what will the requirement do. Available actions are:
-
check
Will only check for blocks that match the list defined in thefilter
property. -
place
Will place the block specified in theblock
property. -
replace_break
Will break any block that match the list defined in thefilter
property and replace it with the block specified in theblock
property. -
replace_destroy
Will destroy any block that match the list defined in thefilter
property and replace it with the block specified in theblock
property. -
break
Will break (and drop) a block that match the list defined in thefilter
property. -
destroy
Will destroy (no drops) a block that match the list defined in thefilter
property.
check
will check for the required block each tick of the recipe and stop the processing if it can't find the blocks.
place
, replace_break
, replace_destroy
, break
, destroy
will do their actions on start of the processing if the mode
property is "input" or on end of the processing if "output".
Difference between break
and destroy
is that break drop loots and destroy doesn't.
"action": "place"
The requirement will place a block.
Pos
A box where the requirement is allowed to check/place/replace/break/destroy blocks.
The box is specified with an array of 6 integers that define each faces position: [left, bottom, front, right, up, back]
.
The box is centered on the machine position, meaning that [0, 0, 0, 0, 0, 0]
represent the machine block and [-1, -1, -1, 1, 1, 1]
represent a 3x3 cube with the center block being the machine.
You can use the in-game box creation tool item to help creating a box.
"pos": [-1, 0, 1, 1, 0, 3]
The box is a 3x3x1 square behind the machine.
Block
A block id in the format namespace:id
ex: minecraft:furnace
.
Some additional blockstate properties can be specified in the format namespace:id[property1=value,property2=value]
ex: minecraft:furnace[lit=true]
, that way the requirement will only care about vanilla furnaces that are lit, and exclude all other.
Some NBT tag can also be specified within {tag1:value,tag2:value}
.
If you're not sure about the syntax, check the vanilla "/setblock" command. It use the same syntax and have autocompletion.
This block will be placed when using place
, replace_break
or replace_destroy
action, for other actions it will be ignored.
"block": "minecraft:air"
An air block. Meaning that the requirement can't place or break blocks.
"block": "minecraft:furnace[lit=true,facing=north]"
The requirement will do it's action only on vanilla furnaces that are lit and placed facing the north.
Filter
A list of blocks or block tags (can be both) that can't be destroyed by the machine (used as a blacklist as default).
The blocks must be specified the same way as in th block
property (see above) e.g: modid:block_id[property=value]{nbt=something}
.
Block tags must be specified using the # prefix e.g: #forge:stone
.
empty (All blocks can be destroyed by the machine.
"filter": ["minecraft:cobblestone", "#forge:stone"]
Allow all blocks but vanilla cobblestone or blocks in the #forge:stone tag to be checked or broken by the machine.
Whitelist
A boolean, if true the filter
property list will be used as a whitelist of blocks that can be destroyed instead of a blacklist.
"whitelist": false
The filter
property will act as a blacklist`.
"whitelist": true
The filter
property will act as a whitelist.
Amount
The amount of blocks to check/place/replace/break/destroy.
All blocks must be in the box defined in the pos
property and match the block defined in the block
property.
"amount": 1
The requirement will check/place/replace/break/destroy only 1 block.
"amount": 9
The requirement will check/place/replace/break/destroy 9 blocks.
If that amount is not respected the processing will not start.
Comparator
A Comparator used only for the check
action, the recipe will be processed only if found_blocks_amount [comparator] specified_amount
, Where specified_amount is defined in the amount
property.
"comparator": ">="
The recipe will be processed only if found_blocks_amount >= specified_amount
.
"comparator": "=="
The recipe will be processed only if found_blocks_amount == specified_amount
.
With the place/replace_break/replace_destroy/break/destroy actions this property have no effect, the found_blocks_amount MUST be greater or equals to the specified_amount or the recipe will not be processed.
Delay
A double value, between 0.0 and 1.0 that represents at which time of the recipe the requirement action must be executed.
A delay of 0.5 represent half of the recipe, 0.25 a quarter etc...
"delay": 0
The requirement action will be executed on start if mode is input or on end if mode is output.
"delay": 0.33
The requirement action will be executed when the recipe progress time is at (approximatively) a third of the recipe total duration.
If delay is specified the requirement will be only executed at the specified delay, independantly of the mode property.
This property have no effect if the action
is set to check
as this action is executed each tick of the recipe.
A Block Requirement that will make the recipe destroy 1 block of full grown wheat in a 5x5x1 area behind the machine (making a harvester):
{
"type": "custommachinery:block",
"mode": "output",
"action": "destroy",
"pos": [-2, 0, 1, 2, 0, 5],
"block": "minecraft:wheat[age=7]"
}
3. Machine GUI
- Dump Element
- Energy Element
- Fluid Element
- Fuel Element
- Player Inventory Element
- Progress Bar Element
- Reset Element
- Slot Element
- Status Element
- Text Element
- Texture Element
5. Catalysts
- Biome Requirement
- Block Requirement
- Command Requirement
- Dimension Requirement
- Drop Requirement
- Durability Requirement
- Effect Requirement
- Energy Requirement
- Energy Per Tick Requirement
- Entity Requirement
- Fluid Requirement
- Fluid Per Tick Requirement
- Fuel Requirement
- Item Requirement
- Light Requirement
- Loot Table Requirement
- Position Requirement
- Structure Requirement
- Redstone Requirement
- Time Requirement
- Weather Requirement