~ mcmonkey's simpler pastebin ~ Inspired by Hastebin ~ home page ~ Denizen help ~
click to use the normal pastebin instead ~ Click to make your own paste ~ click to duplicate and edit this paste


Title:
Type:
Date:
By:
Raw:
Other:
...
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
4300

Grappling Hook 3.0
Denizen Script
2019/11/26 09:50:37 UTC-08:00
Guest
Click here to view this paste as a raw text file | Or download the script


grappling_hook:
  type: item
  debug: false
  material: tripwire_hook
  display name<&a><&l><&n>Grappling Hook
  lore:
  - "<&b><&l>Use this to grapple a block"
  - "<&b><&l>and pull yourself to it."

grappling_hook_events:
  type: world
  debug: false
  events:
    on player right clicks with grappling_hook:
      - if <player.has_flag[grappling]>:
        - narrate "<&c>You can only fire one grappling hook at a time."
        - stop
      - shoot arrow speed:3 script:grappling_hook_pull save:hook
      - flag player grappling:true duration:10s
      - repeat 999:
        - if !<entry[hook].shot_entities.get[1].is_spawned> || !<player.has_flag[grappling]>:
          - stop
        - playeffect redstone at:<player.location.points_between[<entry[hook].shot_entities.get[1].location>].distance[0.5]> quantity:5 special_data:1|gray offset:0.1
        - wait 2t

grappling_hook_pull:
 type: task
 debug: false
 script:
   - if <[location].find.blocks.within[2].filter[material.name.is[!=].to[air]].is_empty> || !<player.can_see[<[last_entity]>]>:
     - narrate "<&c>Unable to grapple to this location from here."
     - flag player grappling:!
   - else:
     - push <player> d:<[location]> script:grappling_hook_sanity def:<[location]>

grappling_hook_sanity:
  type: task
  debug: false
  definitions: loc
  script:
    - flag player grappling:!
    - teleport <[loc].with_pitch[<player.location.pitch>].with_yaw[<player.location.yaw>]>