Entity

Make the recipe check, heal, hurt or kill entities near the machine

Entity requirement is used to check, consume health or kill some entities in a specified radius of the machine.

To use it you need to provide the amount of entities/health you want to check/consume/kill and the radius the machine should search them.

Note that the larger the radius, the more lag it will generate, and the machine doesn't count entities in unloaded chunks.

This requirement is available in both input and output modes.

The requirement type of entity requirement is : "custommachinery:entity"

Properties

The entity requirement have 5 mandatory properties and 2 optional properties.

Mandatory properties

"type": "custommachinery:entity" //Mandatory to define an entity 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 should the requirement check/do. The 4 available actions for entity requirement are :

  • check_amount Will check the amount of entities in the specified radius and compare it to the specified amount.

  • check_health Will check the sum of health of all nearby entities combined and compare it to the specified amount.

  • consume_health Same than "check_health" but will consume the amount of life points on start if mode = input or finish if mode = output.

  • kill Same than "check_amount" but will kill the amount of entities on start if mode = input or finish if mode = output.

Example :

"action": "kill"

The requirement will kill entities.

Amount

Name : amount

Description :

The amount of entities/health to check/consume/kill, the recipe will start/end only if the found amount of entities/health in the specified radius is greater or equals to this amount.

Example :

"amount": 10

The machine will search for 10 entities or 10 health points depending of the specified action.

Radius

Name : radius

Description :

The radius (in blocks) the machine will search entities in, this is a circle centered to the machine.

Example :

"radius": 10

The machine will search for entities in a radius of 10 blocks around it.

Optional properties

Filter

Name : filter

Description :

A blacklist of entities to ignore for when checking.

By default all entities are allowed for "check_amount" and "kill" actions, even non-living ones like item frame or armor stand.

For "check_health" and "consume_health" actions only living entities (all mobs/animals/player) are allowed.

Default : empty

No blacklist.

Example :

"filter": ["minecraft:sheep", "minecraft:cow"]

Allow all entities but vanilla sheeps and cows.

Whitelist

Name : whitelist

Description :

A boolean, if true the filter property will be a whitelist instead of a blacklist and only entities specified in the filter will be allowed.

Default : false

The filter property is a blacklist.

Example :

"whitelist": true

Turn the "filter" property to a whitelist.

Example

An Entity Requirement that will make the recipe kill 10 villagers in a radius of 20 blocks at the end of the process :

The 10 villagers are needed to be in radius during all the crafting process or the machine will error.

{
    "type": "custommachinery:entity",
    "mode": "output",
    "amount": 10,
    "radius": 20,
    "action": "kill",
    "filter": ["minecraft:villager"],
    "whitelist": true
}

Last updated