Paste #49401: Untitled Paste

Date: 2018/08/24 05:39:39 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


EarthWave: 
  type: world 
  debug: true
  events: 
    on player right clicks with item: 
      - 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.center.add[0,-1,0].material>]> { 
          - define materials li@
          - foreach <player.location.points_between[<player.location.cursor_on[20]>]> { 
            - foreach <def[value].as_location.find.surface_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 materials <def[materials].include[<def[value]>]>
            }
          } 
          - foreach <player.location.points_between[<player.location.cursor_on[20]>]> { 
            - foreach <def[value].as_location.find.surface_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 
              - spawn e@falling_block,<def[materials].get[<def[loop_index]>]> <def[value].add[0,1,0]> save:faller 
              - adjust <entry[faller].spawned_entities> "velocity:0,0.3,0" 
              - wait 0.1t
            }
          } 
        } 
      }