{
	"format_version": "1.16.0",
	"minecraft:entity": {
		"description": {
			"identifier": "dds_camping:sleepingbag",
			"is_spawnable": true,
			"is_summonable": true,
			"animations": {
				"general": "controller.animation.dds_camping.furniture",
				"center": "animation.dds_camping.furniture.center",
				"place": "animation.dds_camping.furniture.place",
				"sleep": "controller.animation.dds_camping.sleep",
				"sleep_command": "animation.dds_camping.furniture.sleeping"
			},
			"scripts": {
				"animate": [
					"general",
					"center",
					"sleep",
					{
						"sleep_command": "q.skin_id == 1"
					}
				]
			}
		},
		"component_groups": {
			"default": {
				"minecraft:variant": {
					"value": 0
				}
			},
			"gravity": {
				"minecraft:physics": {
					"has_collision": true,
					"has_gravity": false
				}
			},
			"reset_variant": {
				"minecraft:skin_id": {
					"value" : 0
				}
			},
			"night_variant": {
				"minecraft:skin_id": {
					"value" : 1
				}
			},
			"day_variant": {
				"minecraft:skin_id": {
					"value" : 2
				}
			},
			"transform": {
				"minecraft:transformation": {
					"into": "dds_camping:sleepingbag",
					"delay": {
					"value": 0.1
					}
				}
			},
			"explosion": {
				"minecraft:explode": {
					"fuse_length": 0,
					"fuse_lit": true,
					"power": 5,
					"causes_fire": true,
					"fire_affected_by_griefing": true,
					"destroy_affected_by_griefing": true
				}
			},
			"dds_camping:item_scale": {
				"minecraft:variant": {
					"value": 5
				},
				"minecraft:collision_box": {
					"width": 0.235,
					"height": 0.4
				},
				"minecraft:entity_sensor": {
					"sensor_range": 0.4,
					"event": "dds_camping:spawn_item",
					"event_filters": {
						"test": "is_family",
						"subject": "other",
						"operator": "==",
						"value": "player"
					}
				}
			},
			"dds_camping:available_item": {
				"minecraft:spawn_entity": {
					"entities": [
						{
							"single_use": true,
							"min_wait_time": 0,
							"max_wait_time": 0,
							"spawn_item": "dds_camping:sleepingbag_spawn_egg"
						}
					]
				},
				"minecraft:instant_despawn": {}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"furniture_0"
				]
			},
			"minecraft:interact": {
				"interactions": [
					{
						"on_interact": {
							"filters": [
								{
									"all_of": [
										{
											"test": "is_sneaking",
											"subject": "other",
											"value": false
										}
									]
								}
							],
							"event": "dds_camping:interaction"
						},
						"cooldown": 0.6,
						"use_item": false,
						"play_sounds": "saddle",
						"interact_text": "action.interact.structure_interact"
					},
					{
						"on_interact": {
							"filters": [
								{
									"all_of": [
										{
											"test": "is_sneaking",
											"subject": "other",
											"value": true
										}
									]
								}
							],
							"event": "dds_camping:demolish_structure"
						},
						"cooldown": 0.6,
						"use_item": false,
						"play_sounds": "saddle",
						"interact_text": "action.interact.structure_demolish"
					}
				]
			},
			"minecraft:health": {
				"value": 1,
				"max": 1,
				"min": 1
			},
			"minecraft:nameable": {},
			"minecraft:collision_box": {
				"width": 0.01,
				"height": 0.01
			},
			"minecraft:custom_hit_test": {
				"hitboxes": [
					{
						"width": 1,
						"height": 1,
						"pivot": [
							0,
							0.5,
							0
						]
					}
				]
			},
			"minecraft:jump.static": {},
			"minecraft:physics": {
				"has_gravity": false,
				"has_collision": false
			},
			"minecraft:knockback_resistance": {
				"value": 100,
				"maximum": 100
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"default"
					]
				}
			},
			"dds_camping:demolish_structure": {
				"add": {
					"component_groups": [
						"dds_camping:item_scale",
						"gravity"
					]
				}
			},
			"dds_camping:spawn_item": {
				"remove": {
					"component_groups": [
						"dds_camping:item_scale"
					]
				},
				"add": {
					"component_groups": [
						"dds_camping:available_item"
					]
				}
			},
			"dds_camping:interaction": {
				"sequence": [
					{
						"filters": {
							"all_of": [
								{
									"test": "hourly_clock_time",
									"operator": ">=",
									"value": 12000
								},
								{
									"test": "hourly_clock_time",
									"operator": "<",
									"value": 24000
								},
								{
									"test": "in_nether",
									"operator": "==",
									"value": false
								},
								{
									"test": "has_biome_tag",
									"operator": "!=",
									"value": "the_end"
								}
							]
						},
						"remove": {
							"component_groups": [
								"day_variant"
							]
						},
						"add": {
							"component_groups": [
								"night_variant"
							]
						}
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "hourly_clock_time",
									"operator": ">=",
									"value": 0
								},
								{
									"test": "hourly_clock_time",
									"operator": "<",
									"value": 12000
								}
							],
							"any_of": [
								{
									"test": "in_nether",
									"operator": "==",
									"value": false
								},
								{
									"test": "has_biome_tag",
									"operator": "!=",
									"value": "the_end"
								}
							]
						},
						"remove": {
							"component_groups": [
								"night_variant"
							]
						},
						"add": {
							"component_groups": [
								"day_variant"
							]
						}
					},
					{
						"filters": {
							"any_of": [
								{
									"test": "in_nether",
									"operator": "==",
									"value": true
								},
								{
									"test": "has_biome_tag",
									"operator": "==",
									"value": "the_end"
								}
							]
						},
						"add": {
							"component_groups": [
								"explosion"
							]
						}
					}
				]
			},
			"dds_camping:reset_variant_day": {
				"remove": {
					"component_groups": [
						"day_variant"
					]
				},
				"add": {
					"component_groups": [
						"reset_variant"
					]
				}
			},
			"dds_camping:reset_variant_night": {
				"add": {
					"component_groups": [
						"transform"
					]
				}
			}
		}
	}
}