"dragonmount":
type: world
debug: false
events:
on player chats:
- if <context.message.contains[summon_dragon]> == true && <player.flag[dragonmount]> == true {
- execute as_server "npc create drake --type enderdragon --trait controllable --at '<player.location.add[3,30,125].formatted.citizens>'"
- run dragonentry delay:1s
- execute as_server "npc assign --set mount_despawn_dragon"
- give player i@dragonstaff
- if <player.flag[dragonmaster]> == true { give player i@dragonfirestaff
- execute as_server "npc owner <player.name>"
- determine cancelled
}
on player right clicks with i@dragonstaff:
- determine passively cancelled:false
- if <player> == <player.selected_npc.owner> && !<player.is_inside_vehicle> && <player.location.distance[<player.selected_npc.location>]> < 15 {
- execute as_op "npc mount"
}
on player right clicks with i@dragonfirestaff:
- if <player.flag[dragonmaster]> && <player.is_inside_vehicle> && <player.get_vehicle.entity_type> == ender_dragon {
- define vec <player.selected_npc.location.direction.vector>
- push fireball origin:<player.selected_npc.location.sub[0,4,0].sub[<player.selected_npc.location.direction.vector.mul[10]>]> destination:<player.location.cursor_on[200]> speed:2 duration:1m
- determine cancelled
}
"mount_despawn_dragon":
type: assignment
debug: false
interact scripts:
- 1 despawn_dragon
actions:
on assignment:
- flag player mount:->:<npc.id>
- trigger name:click state:true
- trigger name:chat state:true
- trigger name:proximity state:true
"despawn_dragon":
type: interact
debug: false
steps:
"1":
proximity trigger:
exit:
script:
- ^if <player> == <npc.owner> {
- ^take i@dragonstaff
- ^take i@dragonfirestaff
- ^flag player mount:<-:<npc.id>
- fly <npc> origin:<player.location> destination:<player.location.add[3,10,150]> speed:1.0
- wait 10
- remove <npc>
}
"dragonfirestaff":
type: item
debug: false
material: 369
display name: <red>"Dragon fire staff"
lore:
- Right Clicking with with staff
- will shoot fireballs when dragon
- is mounted
"dragonstaff":
type: item
material: 280
display name: <red>"Dragon staff"
lore:
- Right Clicking with with this staff
- will cause you to mount the dragon
- and will cause your dragon to
- descend while riding it
"dragonentry":
type: task
script:
- fly <player.selected_npc> origin:<player.selected_npc.location> destination:<player.location.add[3,10,45]> speed:1.0