Paste #117443: how can it be...

Date: 2023/11/11 10:32:08 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link



StartGlidingCheck:
  type: world
  debug: false
  events:
    after player starts gliding:
    - inject ElytraDamagedSlowDown

ElytraDamagedSlowDown:
  type: task
  debug: true
  script:
  - flag <player> ElytraReduction:0.5 expire:5s
  - if !<player.has_flag[ElytraDamagedSlowDownLoopOn].if_null[false]> && <player.has_flag[GetDamagedin5s].if_null[false]>:
    - narrate triggered!!!!!!!!!
    - while <player.has_flag[GetDamagedin5s].if_null[false]>:
      - define total_velocity <player.velocity.x.abs.add[<player.velocity.y.abs>].add[<player.velocity.z.abs>]>
      - flag <player> ElytraReduction:<player.flag[ElytraReduction].add[0.005]>
      - if <player.gliding.if_null[false]> && <[total_velocity]> >= <player.flag[ElytraReduction]> :
        - adjust <player> velocity:<player.velocity.mul[<player.flag[ElytraReduction]>]>
      - wait 1t
  - flag <player> ElytraDamagedSlowDownLoopOn expire:5s

OnDamageEvent:
  type: world
  debug: true
  events:
    on player damaged:
#DamageFlagPart
      - flag <player> GetDamagedin5s expire:5s
      - inject ElytraDamagedSlowDown