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

A list of items or items tags (can be both) that will be checked or consumed by the machine.

Default : empty

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

Example :

"input": ["minecraft:cobblestone", "#forge:stone"]

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.

NBT

Name : nbt

Description :

A string that represent a nbt tag that will be required on the checked/consumed items, or added to the produced items. If the drop requirement is in check or consume action it will search for items around the machine that have AT LEAST those nbt tag, if the item have more tag it's fine as long as it have all the tags specified in this property. The nbt tag must be defined the same way you use it in the /give command.

You can see the nbt tag of an item using /data get entity @s SelectedItem and then copy the part after tag: inside {}.

Default :

Nothing (no nbt tags)

Example :

"nbt": "{'test1': true, 'Amount': 10}"

The item requirement will search for items with nbt tag "test1" with value true and tag "Amount" with value 10.

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": "#forge:stone",
    "amount": 5,
    "radius": 5
}

Last updated