Paste #71653: Untitled Paste

Date: 2020/06/30 04:59:03 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


JetpackFly:
  Type: world
  Debug: true
  Events:
    on player starts sneaking:
      - if <player.equipment.chestplate.nbt[jetpack_mark]||false> == <player.item_in_hand.nbt[fuel_type]||false>:
        - flag player usingfuel
        - while <player.has_flag[usingfuel]> && <player.item_in_hand.has_nbt[fuel_type]||null>:
          - inventory adjust slot:<player.held_item_slot> nbt:fuel_count/<player.item_in_hand.nbt[fuelcount].sub[0.01]>
          - cast levitation d:0.6 amplifier:<player.item_in_hand.nbt[grade]||null> no_ambient no_icon hide_particles
          - repeat 10:
            - playeffect effect:CLOUD at:<player.location.add[0,-1,0]> quantity:15 offset:0.05,0.4,0.05
            - playeffect effect:FLAME at:<player.location.add[0,0.1,0]> quantity:10 offset:0.05,0.08,0.05
            - wait 1t
          - if <player.has_flag[hasbossbar]>:
            - bossbar update <player.uuid> players:<player> title:<&c>Fuel<&sp>Remaining progress:<player.item_in_hand.nbt[fuel_count]> color:<list[red|yellow|green].get[<player.item_in_hand.nbt[fuelcount].mul[3].round_up>]>
          - else:
            - bossbar <player.uuid> players:<player> title:<&c>Fuel<&sp>Remaining progress:<player.item_in_hand.nbt[fuel_count]> color:<list[red|yellow|green].get[<player.item_in_hand.nbt[fuelcount].mul[3].round_up>]>
            - flag player hasbossbar
          - if <player.item_in_hand.nbt[fuel_count]> <= 0.01:
            - take iteminhand quantity:1
            - flag player hasbossbar:!
            - bossbar remove <player.uuid> players:<player>
            - inventory set o:bucket slot:<player.held_item_slot>
            - narrate "Thanks for flying ryan air"
    on player stops sneaking flagged:usingfuel:
      - flag player usingfuel:!
      - wait 5
      - flag player hasbossbar:!
      - if !<server.current_bossbars.contains[<player.uuid>]>:
        - stop
      - else:
        - bossbar remove <player.uuid>