{
    "format_version": "1.16.0",
    "minecraft:block": {
      "description": {
        "identifier": "loled:beach_bucket",
        "properties": {
          "loled:face": [
            0,
            1,
            2,
            3
          ],
          "loled:areia": [
            0,
            1,
            2,
            3,
            4
          ]
        }
      },
      "components": {
        "minecraft:material_instances": {
          "*": {
            "texture": "bucket_vazio",
            "render_method": "alpha_test"
          }
        },
        "minecraft:pick_collision": {
          "origin": [
            -6,
            0,
            -6
          ],
          "size": [
            12,
            16,
            16
          ]
        },
        "minecraft:creative_category": {
          "group": "itemGroup.name.beach",
          "category": "construction"
        },
        "minecraft:loot": "loot_tables/beach/beach_bucket.json",
        "minecraft:geometry": "geometry.bucket_vazio",
        "minecraft:destroy_time": 2,
        "minecraft:block_light_absorption": 0,
        "minecraft:entity_collision": {
          "origin": [
            -6,
            0,
            -6
          ],
          "size": [
            12,
            16,
            16
          ]
        },
        "minecraft:friction": 0.6,
        "minecraft:map_color": "#00ff00",
        "minecraft:flammable": {
          "flame_odds": 0,
          "burn_odds": 0
        },
        "minecraft:on_interact": {
          "event": "loled:toggle",
          "condition": "query.get_equipped_item_name=='sand'"
        },
        "minecraft:on_player_placing": {
          "event": "loled:face"
        }
      },
      "permutations": [
        {
          "condition": "query.block_property('loled:face') == 0",
          "components": {
            "minecraft:rotation": [
              0,
              180,
              0
            ]
          }
        },
        {
          "condition": "query.block_property('loled:face') == 1",
          "components": {
            "minecraft:rotation": [
              0,
              0,
              0
            ]
          }
        },
        {
          "condition": "query.block_property('loled:face') == 2",
          "components": {
            "minecraft:rotation": [
              0,
              270,
              0
            ]
          }
        },
        {
          "condition": "query.block_property('loled:face') == 3",
          "components": {
            "minecraft:rotation": [
              0,
              90,
              0
            ]
          }
        },
        {
          "condition": "query.block_property('loled:areia')==1",
          "components": {
            "minecraft:geometry": "geometry.bucket_areia",
            "minecraft:block_light_absorption": 0,
            "minecraft:on_interact": {
              "event": "areia_1"
            },
            "minecraft:material_instances": {
              "*": {
                "texture": "bucket_areia",
                "render_method": "alpha_test"
              }
            }
          }
        },
        {
          "condition": "query.block_property('loled:areia')==2",
          "components": {
            "minecraft:geometry": "geometry.bucket_virado",
            "minecraft:block_light_absorption": 0,
            "minecraft:on_interact": {
              "event": "nothing"
            },
            "minecraft:ticking": {
              "looping": true,
              "range": [
                1,
                6
              ],
              "on_tick": {
                "event": "areia_ready"
              }
            },
            "minecraft:material_instances": {
              "*": {
                "texture": "bucket_areia",
                "render_method": "alpha_test"
              }
            }
          }
        },
        {
          "condition": "query.block_property('loled:areia')==3",
          "components": {
            "minecraft:geometry": "geometry.bucket_virado",
            "minecraft:block_light_absorption": 0,
            "minecraft:on_interact": {
              "event": "areia_2"
            },
            "minecraft:material_instances": {
              "*": {
                "texture": "bucket_areia",
                "render_method": "alpha_test"
              }
            }
          }
        },
        {
          "condition": "query.block_property('loled:areia')==4",
          "components": {
            "minecraft:loot": "loot_tables/beach/none.json",
            "minecraft:geometry": "geometry.sand_castle",
            "minecraft:block_light_absorption": 0,
            "minecraft:on_interact": {
              "event": "nothing"
            },
            "minecraft:material_instances": {
              "*": {
                "texture": "sand",
                "render_method": "alpha_test"
              }
            }
          }
        }
      ],
      "events": {
        "loled:face": {
          "set_block_property": {
            "loled:face": "query.cardinal_facing_2d-2"
          }
        },
        "loled:toggle": {
          "set_block_property": {
            "loled:areia": "query.block_property('loled:areia')+1"
          },
          "decrement_stack": {}
        },
        "areia_1": {
          "set_block_property": {
            "loled:areia": 2
          }
        },
        "areia_2": {
          "set_block_property": {
            "loled:areia": 4
          },
          "spawn_loot": {
            "table": "loot_tables/beach/beach_bucket.json"
          }
        },
        "areia_ready": {
          "set_block_property": {
            "loled:areia": 3
          }
        }
      }
    }
  }