{
	"display": {
		"icon": {
			"id": "minecraft:chiseled_bookshelf"
		},
		"title": {"translate":"The Power of Books"},
		"description": {"color":"green","translate":"Read the power signal of a Chiseled Bookshelf using a comparator"},
		"announce_to_chat": true
	},
	"parent": "blazeandcave:redstone/comparing_comparator",
	"rewards": {
		"function": "bacap_rewards:redstone/the_power_of_books"
	},
	"criteria": {
		"chiseled_bookshelf": {
			"trigger": "minecraft:placed_block",
			"conditions": {
				"location": [
					{
						"block": "minecraft:chiseled_bookshelf",
						"condition": "minecraft:block_state_property"
					},
					{
						"condition": "minecraft:any_of",
						"terms": [
							{
								"condition": "minecraft:location_check",
								"offsetZ": 1,
								"predicate": {
									"block": {
										"blocks": [
											"minecraft:comparator"
										],
										"state": {
											"facing": "north"
										}
									}
								}
							},
							{
								"condition": "minecraft:location_check",
								"offsetZ": -1,
								"predicate": {
									"block": {
										"blocks": [
											"minecraft:comparator"
										],
										"state": {
											"facing": "south"
										}
									}
								}
							},
							{
								"condition": "minecraft:location_check",
								"offsetX": 1,
								"predicate": {
									"block": {
										"blocks": [
											"minecraft:comparator"
										],
										"state": {
											"facing": "west"
										}
									}
								}
							},
							{
								"condition": "minecraft:location_check",
								"offsetX": -1,
								"predicate": {
									"block": {
										"blocks": [
											"minecraft:comparator"
										],
										"state": {
											"facing": "east"
										}
									}
								}
							}
						]
					}
				]
			}
		},
		"comparator": {
			"trigger": "minecraft:placed_block",
			"conditions": {
				"location": [
					{
						"condition": "minecraft:any_of",
						"terms": [
							{
								"condition": "minecraft:all_of",
								"terms": [
									{
										"block": "minecraft:comparator",
										"condition": "minecraft:block_state_property",
										"properties": {
											"facing": "north"
										}
									},
									{
										"condition": "minecraft:location_check",
										"offsetZ": -1,
										"predicate": {
											"block": {
												"blocks": [
													"minecraft:chiseled_bookshelf"
												]
											}
										}
									}
								]
							},
							{
								"condition": "minecraft:all_of",
								"terms": [
									{
										"block": "minecraft:comparator",
										"condition": "minecraft:block_state_property",
										"properties": {
											"facing": "south"
										}
									},
									{
										"condition": "minecraft:location_check",
										"offsetZ": 1,
										"predicate": {
											"block": {
												"blocks": [
													"minecraft:chiseled_bookshelf"
												]
											}
										}
									}
								]
							},
							{
								"condition": "minecraft:all_of",
								"terms": [
									{
										"block": "minecraft:comparator",
										"condition": "minecraft:block_state_property",
										"properties": {
											"facing": "west"
										}
									},
									{
										"condition": "minecraft:location_check",
										"offsetX": -1,
										"predicate": {
											"block": {
												"blocks": [
													"minecraft:chiseled_bookshelf"
												]
											}
										}
									}
								]
							},
							{
								"condition": "minecraft:all_of",
								"terms": [
									{
										"block": "minecraft:comparator",
										"condition": "minecraft:block_state_property",
										"properties": {
											"facing": "east"
										}
									},
									{
										"condition": "minecraft:location_check",
										"offsetX": 1,
										"predicate": {
											"block": {
												"blocks": [
													"minecraft:chiseled_bookshelf"
												]
											}
										}
									}
								]
							}
						]
					}
				]
			}
		}
	},
	"requirements": [
		[
			"comparator",
			"chiseled_bookshelf"
		]
	]
}