Inventory
Entity Condition Type
Checks if the inventory of the entity is occupied.
Type ID: origins:inventory
Fields
Field | Type | Default | Description |
---|---|---|---|
inventory_types |
Array of Inventory Types | ["inventory"] |
Determines whether to check for items in the entity's inventory, inventories of powers present in the entity, or both. |
process_mode |
Process Mode | "items" |
Determines how the item stacks in the specified inventory/inventories are evaluated. |
item_condition |
Item Condition Type | optional | If specified, only account for items from the specified inventory/inventories that fulfill this condition. |
slots |
Array of Item Slots | optional | If specified, only items from these specified item slots are evaluated. |
slot |
Item Slot | optional | If specified, only the item from this specified item slot is evaluated. |
power |
Identifier | optional | If specified and if inventory_type is "power" , the items in the inventory of this power will be evaluated instead. |
comparison |
Comparison | ">" |
Determines how the amount of items/stacks that were evaluated should be compared to the specified value. |
compare_to |
Integer | 0 |
The value at which the amount of items/stacks that were evaluated will be compared to. |
Examples
"condition": {
"type": "origins:inventory",
"process_mode": "stacks",
"comparison": ">=",
"compare_to": 10
}
This example will check if 10 or more slots are occupied by any items in the entity's inventory.
"condition": {
"type": "origins:inventory",
"process_mode": "items",
"item_condition": {
"type": "origins:ingredient",
"ingredient": {
"tag": "minecraft:flowers"
}
},
"comparison": "<",
"compare_to": 16
}
This example will check if 15 or less individual items that are included in the #minecraft:flowers
(data/minecraft/tags/items/flowers.json
) item tag are in the inventory of the entity.