Effect

Make the recipe give an effect to a nearby entity

Effect requirement is used to make the custom machine give effects to entities.

This requirement doesn't have a mode and will never stop the processing of a recipe.

The effect can be given every tick or only at the end of the crafting process (see the finish property below).

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

Properties

The effect requirement has 4 mandatory properties and 5 optional properties.

Mandatory properties

"type": "custommachinery:effect" //Mandatory to define an effect requirement.
Effect

Name : effect

Description :

An effect ID, it can be any registered effect modded or vanilla. The effect ID must be defined by nemaspace:id like minecraft:levitation for example.

Example :

"effect": "minecraft:strength"

The requirement will apply a vanilla Strength effect.

Time

Name : time

Description :

A positive integer that define the duration in ticks of the effect.

Example :

"time": 100

The effect duration will be 100 ticks -> 5 seconds.

Radius

Name : radius

Description :

A positive integer that define the radius around the machine where the effect will be applied. The radius is in block size and is a circle.

Example :

"radius": 10

The effect will be applied in all entities within 10 blocks of the machine.

Optional properties

Level

Name : level

Description :

A positive integer that define level of the effect, vanilla hardcode the effect level limit at 255.

Default : 1

The effect will be applied at level 1.

Example :

"level": 4

The effect will be applied at level 4.

Filter

Name : filter

Description :

An array of entity ID that can have the effect applied. Any registered entity ID can be used here and must be specified in the format namespace:id like minecraft:zombie for example.

Default : empty

Any entity can have the effect applied.

Example :

"filter": ["minecraft:zombie", "minecraft:villager"]

The effect will only be given to vanilla zombies and villagers. The [] are not required if only one entity ID is specified.

Finish

Name : finish

Description :

A boolean, if true the effect will only be applied at the end of the crafting process, if false the effect will be applied each tick while the machine is running.

Default : false

The effect is applied each tick of the crafting process.

Example :

"finish": true

The effect is applied only once, at the end of the crafting process.

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 command to be run.

Default : 1

The command will always be run.

Example :

"chance": 0.7

The command will have 70% chance to be run.

Example

An effect requirement that add a 10 seconds, level 2 absorption effect to all players (and only players) in an area of 50 blocks at the end of the recipe:

{
    "type": "custommachinery:effect",
    "effect": "minecraft:absorption",
    "time": 200,
    "radius": 50,
    "level": 2,
    "filter": "minecraft:player",
    "finish": true
}

Last updated