Loot Conditions Near Block - Tmtravlr/LootOverhaul GitHub Wiki

Loot Conditions - Near Block

Structure:

Property Type Description
radius Integer The radius to search for the block.
block String or String List Possible block names to be near. (Optional)
meta Float, Float Range, or Float List The metadata of the blocks. (Optional)
state Object The state of the blocks, as a json object. (Optional)

Description:

Will pass if the blocks are found within the given radius

Example Usage: Within 0 blocks of (so inside) water or lava

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": [
 			"minecraft:flowing_water",
 			"minecraft:water",
 			"minecraft:flowing_lava",
 			"minecraft:lava"
 		],
 		"radius": 0
 	}
]

Or a single block: Within 5 blocks of mossy cobblestone

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": "minecraft:mossy_cobblestone",
 		"radius": 5
 	}
]

Or a block with metadata: Beside a dispenser facing upwards

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": "minecraft:dispenser",
 		"meta": 1,
 		"radius": 1
 	}
]

Or a block with a range of metadata: Near wheat, carrot, or potato crops that are at least halfway grown

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": [
 			"minecraft:wheat",
 			"minecraft:carrots",
 			"minecraft:potatoes"
 		],
 		"meta": {
 			"min": 4
 		},
 		"radius": 6
 	}
]

Or a list metadata: Near oak or dark oak planks

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": "minecraft:planks",
 		"meta": [
 			0,
 			5
 		],
 		"radius": 6
 	}
]

Or a block with a block state: Next to a dispenser facing upwards

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"block": "minecraft:dispenser",
 		"state": {
 			"facing": "up"
 		},
 		"radius": 1
 	}
]

Or only a block state: Next to any purple or pink block (wool, terracotta, concrete, etc.)

"conditions": [
 	{
 		"condition": "lootoverhaul:near_block",
 		"state": {
 			"color": [
 				"purple",
 				"pink"
 			]
 		},
 		"radius": 1
 	}
]
Previous - NBT Matches Back Next - Not
⚠️ **GitHub.com Fallback** ⚠️