EarthWave:
type: world
events:
on player clicks with item:
- if <context.location.material.is[==].to[m@air].not> queue clear
- if <player.flag[element].is[==].to[earth].not> queue clear
- if <player.has_flag[element_toggled]> queue clear
- define cursor <player.location.cursor_on[20]>
- define vm 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
- - define source <player.location.add[<player.location.direction.vector.mul[2]>]>
+ - define source <player.location>
- define blocks li@
- define materials li@
- foreach <def[source].points_between[<def[cursor]>]> {
- if <def[blocks].contains[<def[value]>]> foreach next
- define blocks <def[blocks].include[<def[value]>]>
}
- foreach <def[blocks].parse[material.id]> {
- define materials <def[materials].include[<def[value]>]>
}
- foreach <def[blocks]> {
- modifyblock <def[value]> m@air
- spawn e@falling_block,<def[materials].get[<def[loop_index]>]> save:fallingblock
- adjust <entry[fallingblock].spawned_entities> "velocity:0,0.2,0"
- adjust <entry[fallingblock].spawned_entities> "fallingblock_drop_item:false"
}