Paste #122938: Unnamed Denizen Script Paste

Date: 2024/05/22 10:14:43 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


force_heal:
    type: task
    script:
        - ratelimit <player> 12s
        - itemcooldown diamond duration:12
        - cast slow <player> amplifier:1 duration:8s no_clear no_icon hide_particles
        - define playerLoc <player.location>
        - flag player healing:true
        - repeat 8:
            - wait 1s
            - if !<player.flag[healing]> || <player.location.distance[playerLoc]> > 0.5:
                - cast slow remove <player>
                - flag player healing:!
                - stop
            - define target <player.eye_location.ray_trace_target[ignore=<player>;range=8;raysize=0.3]||null>
            - if <[target]> != null || (<[target].is_player> || <[target].is_mob> || <[target].is_npc>):
                - heal <[target]> 1
                - narrate "healing target: <[target].name>"
            - else:
              - heal <player> 1
              - narrate "healing target: <player.name>"