Paste #71672: Untitled Paste

Date: 2020/06/30 06:32:16 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


test_for_items:
  Type: world
  Debug: true
  Events:
    on player starts sneaking:
      - if <player.has_flag[using_fuel]>:
        - wait 1t
      - if !<player.equipment.chestplate.has_nbt[jetpack_mark]> || !<player.item_in_hand.has_nbt[fuel_type]>:
        - stop
      - if <player.equipment.chestplate.nbt[jetpack_mark]> == <player.item_in_hand.nbt[fuel_type]>:
        - flag player usingfuel
        - run <script> path:jetpack_fly

    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>


  jetpack_fly:
    - run <script> path:jetpack_fly_particles
    - cast levitation d:0.6 amplifier:<player.item_in_hand.nbt[grade]> no_ambient no_icon hide_particles
    - 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[fuel_count].sub[0.01]>
      - 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[fuel_count].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[fuel_count].mul[3].round_up>]>
        - flag player hasbossbar
      - if <player.item_in_hand.nbt[fuel_count]> <= 0.01:
        - run <script> path:jetpack_fly_stop

  jetpack_fly_particles:
    - while <player.has_flag[using_fuel]>:
      - 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


  jetpack_fly_stop:
    - 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"