{
	"format_version": "1.19.10",
	"minecraft:entity": {
		"description": {
			"identifier": "dds_camping:blanket",
			"is_summonable": true,
			"is_spawnable": true,
			"animations": {
                "general": "controller.animation.dds_camping.furniture",
                "center": "animation.dds_camping.furniture.center",
                "place": "animation.dds_camping.furniture.place",
				"effect": "controller.animation.dds_camping.give_effect"
            },
            "scripts": {
                "animate": [
				"general",
				{
					"effect": "q.has_rider"
				}
				]
            }
		},
		"component_groups": {
			"default": {
                "minecraft:variant": {
                    "value": 0
                },
                "minecraft:timer": {
                    "time": 0.5,
                    "looping": true,
                    "time_down_event": {
                        "event": "dds_camping:after_spawn",
                        "target": "self"
                    }
                }
            },
            "gravity": {
                "minecraft:physics": {
                    "has_collision": true,
                    "has_gravity": false
                }
            },
            "origin": {
                "minecraft:variant": {
                    "value": 1
                },
				"minecraft:rideable": {
					"controlling_seat": 0,
					"family_types": [
						"player"
					],
					"interact_text": "hint.action.ride.blanket",
					"pull_in_entities": true,
					"rider_can_interact": false,
					"seat_count": 1,
					"seats": [
						{
							"position": [
								0,
								-0.1,
								0
							]
						}
					]
				}
            },
            "dds_camping:item_scale": {
                "minecraft:variant": {
                    "value": 5
                },
                "minecraft:collision_box": {
                    "width": 1,
                    "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:blanket_spawn_egg"
                        }
                    ]
                },
                "minecraft:instant_despawn": {}
            },
            "dds_camping:default_item": {
                "minecraft:mark_variant": {
                    "value": 0
                }
            }
		},
		"components": {
			"minecraft:health": {
				"value": 1
			},
			"minecraft:scale": {
				"value": 1.2
			},
			"minecraft:physics": {
				"has_collision": true,
				"has_gravity": true
			},
			"minecraft:interact": {
                "interactions": [
                    {
                        "on_interact": {
                            "filters": [
                                {
                                    "all_of": [
                                        {
                                            "test": "is_sneaking",
                                            "subject": "other",
                                            "value": true
                                        },
                                        {
                                            "test": "is_mark_variant",
                                            "subject": "self",
                                            "value": 0
                                        }
                                    ]
                                }
                            ],
                            "event": "dds_camping:demolish_structure"
                        },
                        "cooldown": 0.6,
                        "use_item": false,
                        "interact_text": "action.interact.structure_demolish"
                    }
                ]
            },
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			},
			"minecraft:collision_box": {
				"width": 0.1,
				"height": 0.1
			},
			"minecraft:custom_hit_test": {
				"hitboxes": [
					{
						"width": 2,
						"height": 1,
						"pivot": [
							0,
							0.5,
							0
						]
					}
				]
			},
			"minecraft:jump.static": {},
			"minecraft:knockback_resistance": {
				"value": 1
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			}
		},
		"events": {
			 "minecraft:entity_spawned": {
                "add": {"component_groups": ["default"]}
            },
            "dds_camping:after_spawn": {
                "add": {
                    "component_groups": ["origin"]
                },
                "remove": {
                    "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:origin": {
                "add": {"component_groups": ["origin"]}
            }
		}
	}
}