Date: 2020/06/30 06:32:16 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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"