import json

def create_structure(input_array):
    # Define the basic template with placeholders
    template = {
        "type": "origins:chance",
        "chance": 0.05,
        "action": {
            "type": "origins:drop_inventory",
            "inventory_type": "inventory",
            "item_condition": {
                "inverted": True,
                "type": "origins:nbt",
                "nbt": "{Perseverance:1b}"
            },
            "slots": [],
            "slot": "**INDEX**",
            "amount": 64,
            "throw_randomly": True,
            "retain_ownership": True
        }
    }
    
    # Initialize an empty list to hold the final structure
    structure = []
    
    # Iterate over the input array and populate the structure
    for index, value in enumerate(input_array):
        # Create a copy of the template to modify
        item = json.loads(json.dumps(template))  # Deep copy of the template
        # Replace the placeholder with the current value
        item["action"]["slot"] = value
        # Append the modified item to the structure list
        structure.append(item)
    
    return structure

# Example usage
input_array = [
                    "armor.chest",
                    "armor.feet",
                    "armor.head",
                    "armor.legs",
                    "inventory.0",
                    "inventory.1",
                    "inventory.2",
                    "inventory.3",
                    "inventory.4",
                    "inventory.5",
                    "inventory.6",
                    "inventory.7",
                    "inventory.8",
                    "inventory.9",
                    "inventory.10",
                    "inventory.11",
                    "inventory.12",
                    "inventory.13",
                    "inventory.14",
                    "inventory.15",
                    "inventory.16",
                    "inventory.17",
                    "inventory.18",
                    "inventory.19",
                    "inventory.20",
                    "inventory.21",
                    "inventory.22",
                    "inventory.23",
                    "inventory.24",
                    "inventory.25",
                    "inventory.26",
                    "hotbar.0",
                    "hotbar.1",
                    "hotbar.2",
                    "hotbar.3",
                    "hotbar.4",
                    "hotbar.5",
                    "hotbar.6",
                    "hotbar.7",
                    "hotbar.8"]
output = create_structure(input_array)
print(json.dumps(output, indent=4))
