Paste #49366: Edit of P#49365 - Edit of P#49364 - Edit of P#49363 - Untitled Paste

Date: 2018/08/23 07:50:56 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


EarthDig:
    type: world
    debug: false
    events:
      on player left clicks:
      - if <player.flag[element]> == earth && !<player.has_flag[element_toggled]> {
        - if <li@m@sand|m@clay|m@dirt|m@grass|m@gravel|m@diorite|m@cobblestone|m@stone|m@polished_diorite|m@andesite|m@polished_andesite|m@granite|m@polished_granite.contains[<player.location.cursor_on[5].material>]> {
          - define bmat <player.location.cursor_on[5].find.blocks[<li@m@sand|m@clay|m@dirt|m@grass|m@gravel|m@diorite|m@cobblestone|m@stone|m@polished_diorite|m@andesite|m@polished_andesite|m@granite|m@polished_granite>].within[2].parse[material.id]>
          - define blocs li@
          - foreach <player.location.cursor_on[5].find.blocks[<li@m@sand|m@clay|m@dirt|m@grass|m@gravel|m@diorite|m@cobblestone|m@stone|m@polished_diorite|m@andesite|m@polished_andesite|m@granite|m@polished_granite>].within[2]> {
            - modifyblock <def[value]> m@air
            - playsound <def[value]> sound:BLOCK_STONE_BREAK
            - define blocs <def[blocs].include[<def[value]>]>
            - playeffect <def[value]> effect:blockdust_<def[bmat].get[<def[loop_index]>]> quantity:25
            }
          - wait 2m
          - foreach <def[blocs]> {
            - define current <def[blocs].get[<def[loop_index]>]>
            - foreach <def[bmat]> {
              - modifyblock <def[current]> <def[value]>
              }
            }
          }
        }