Paste #49457: Edit of P#49455 - Edit of P#49453 - Edit of P#49451 - Edit of P#49449 - Edit of P#49447 - Edit of P#

Date: 2018/08/26 06:46:16 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


EarthRide:
    type: world
    debug: true
    events:
        on player starts sneaking:
            - if <player.has_flag[EarthRideActive]> {
                - flag <player> EarthRideActive:!
                - queue clear
            }
            - ^if <player.is_on_ground> {
                - queue clear
            }
            - if <player.flag[element]> != earth {
                - queue clear
            }
            - if <player.has_flag[element_toggled]> {
                - queue clear
            }
            - if <player.location.cursor_on[5].material> != m@air {
                - queue clear
            }
            - 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,-2,0].material>]> {
                - if <player.has_flag[EarthRideActive]> {
                    - flag <player> EarthRideActive:!
                    - queue clear
                }
                - flag <player> EarthRideActive
            }
        on player walks:
            - if <player.has_flag[EarthRideActive]> {
                - 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>]> {
                    - queue clear
                }
                - adjust <player> "velocity:<player.location.direction.vector.mul[1].add[0,0.19,0]>"
                - define bmat li@
                - foreach <player.location.center.add[0,-1,0].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.name]> {
                  - define bmat <def[bmat].include[<def[value]>]>
                }
                - foreach <player.location.center.add[0,-1,0].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[bmat].as_list.get[<def[loop_index]>]> <def[value]> save:fallingblock
                  - adjust <entry[fallingblock].spawned_entities> "velocity:0,0.2,0"
                  - adjust <entry[fallingblock].spawned_entities> fallingblock_drop_item:false
                  - wait 0,1t
                  - if <def[value].material.name> != <def[bmat].as_list.get[<def[loop_index]>]> {
                    - modifyblock <def[value]> <def[bmat].as_list.get[<def[loop_index]>]>
                  }
                }
                - playsound <player.location> sound:BLOCK_STONE_BREAK volume:25
            }