Paste #123581: Unnamed Denizen Script Paste

Date: 2024/06/08 14:01:18 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


force_push:
    type: task
    debug: true
    definitions: target|multiplier
    script:
        - if <[target].location.if_null[null]> == null:
            # it's a block
            - narrate "pushing in <[target].direction.vector>"
            - define material <[target].material>
            - define block_display block_display[material=<[material]>;translation=-0.5,0,-0.5]
            - define offset 0.5,0,0.5
            - spawn <[block_display]> <[target].center.round_down.add[<[offset]>]> save:s
            - define ent <entry[s].spawned_entity>
            - define shulker shulker[has_ai=false;invulnerable=true;persistent=true;shulker_peek=0;silent=true;visible=false]
            - mount <[shulker]>|<[ent]> <[target].round_up>
            - teleport <[ent]> <[target].center.round_down.add[<[offset]>]>
            - modifyblock <[target]> air
            - define stop false
            - define max_distance <[target].ray_trace[range=7;return=block].sub[<location[0,1,0]>]||<[target].above[7]>>
            - narrate <[max_distance]>
            - playsound <[target]> sound:entity_warden_emerge volume:<util.random.decimal[0.7].to[1]> pitch:<util.random.decimal[0.8].to[1]>
            - push <[ent]> origin:<[ent].location> destination:<[ent].location.forward[10]> speed:0.3 no_rotate duration:5s