Drop

Make the recipe drop or consume item on ground

Drop requirement is used to check/consume/drop items on ground near the machine.

This requirement is available in both input and output modes.

The requirement type of drop requirement is : "custommachinery:drop".

Properties

The drop requirement has 3 mandatory properties and 6 optional properties.

Mandatory properties

"type": "custommachinery:drop" //Mandatory to define a drop requirement.
Mode

Name : mode

Description :

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.

Example :

"mode": "input"

The requirement will be processed at the start of the crafting process.

Action

Name : action

Description :

Define what will the requirement do. Available actions are:

  • check Will only check for items that match the list defined in the input property.

  • consume Will consume items that match the list defined in the input property.

  • produce Will drop the item specified in the output property near the machine.

check will check for the required items each tick of the recipe and stop the processing if it can't find the items.

consume and produce will do their actions on start of the processing if the mode property is "input" or on end of the processing if "output".

Example :

"action": "consume"

The machine will consume items on ground.

Optional properties

Output

Name : output

Description :

An item to drop if the action property is set to produce

Default :

"output": "minecraft:air"

An air item, meaning nothing will be dropped.

Example :

"output": "minecraft:diamond"

The requirement will drop a vanilla diamond on ground.

Note :

This property is optional for check and consume actions, but mandatory for produce action.

Input

Name : input

Description :

An ingredient with one of the following syntax :

  • For items

"input": {
    "item": "item_id"
}

"item_id" is the registry name of the item you want to be consumed by the recipe.

It must be specified like namespace:item_registry_name with "namespace" being either "minecraft" if the item is from vanilla or a mod ID if the item is from a mod (ex : minecraft:diamond or mekanism:copper_ingot).

  • For tags

"input": {
    "tag": "tag_id"
}

"tag_id" is a tag grouping any item that can be consumed by the recipe.

Default : empty

The machine will not be able to check or consume any items.

Example :

"input": {
    "item": "minecraft:cobblestone"
}

The machine will check or consume only vanilla cobblestone or items in the #forge:stone tag.

Whitelist

Name : whitelist

Description :

A boolean, if false the input property list will be used as a blacklist of items instead of a whitelist.

Default : true

The input property will act as a whitelist.

Example :

"whitelist": false

The input property will act as a blacklist.

Amount

Name : amount

Description :

The amount of items to check/consume or produce.

Default : 1

The requirement will check, consume or produce 1 item.

Example :

"amount": 9

The recipe will check/consume 9 items matching the list defined in the input property (if whitelist), the crafting process will be stopped if the required amount of items are not found. If action property is produce this property defines the amount of items produced.

Radius

Name : radius

Description :

An integer defining the maximal range from the center of the machine that the items will be searched. This does not affect produced items.

Default : 1

1 block radius, in a sphere shape around the center of the machine.

Example :

"radius": 3

The radius is set to 3 blocks around the machine.

Delay

Name : delay

Description :

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...

Default : 0

The requirement action will be executed on start if mode is input or on end if mode is output.

Example :

"delay": 0.33

The requirement action will be executed when the recipe progress time is at (approximatively) a third of the recipe total duration.

Note :

If delay is specified the requirement will be only executed at the specified delay, independently 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.

Chance

Name : chance

Description :

A double between 0.0 and 1.0 that define the chance of the requirement to be processed.

Default : 1

The requirement will always be processed.

Example :

"chance": 0.7

The requirement will have 70% chance to be processed.

Example

A Drop Requirement that will make the recipe drop 3 diamonds on the ground at the end of the crafting process with a 33% chance.

{
    "type": "custommachinery:drop",
    "mode": "output",
    "action": "produce",
    "output": "minecraft:diamond",
    "chance": 0.33
}

A drop requirement that will make the recipe check for 5 items in the #forge:stone tag in a 5 blocks radius during all the crafting process.

{
    "type": "custommachinery:drop",
    "mode": "input",
    "action": "check",
    "input": {
        "tag": "forge:stone"
    },
    "amount": 5,
    "radius": 5
}

Last updated