Date: 2020/11/11 12:38:48 UTC-08: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
rtp_command:
type: command
name: rtp
debug: false
description: randomly teleports you
usage: /rtp
permission: behr.essentials.rtp
script:
# % ██ [ define integers/ invalid blocks ] ██
- define distance 6000
- define blocks <list[grass_block]>
# % ██ [ check world ] ██
- if <player.world.name> == Hub:
- narrate "<&c>You can't use this in <&a>Hub! <&a>Available in: <&f>(<&6>Resource<&f>, <&6>Survival<&f>)"
- stop
# % ██ [ check for cooldown ] ██
- if <player.has_flag[behr.essentials.rtpcooldown]>:
- narrate "<&c>You must wait: <&6><player.flag[behr.essentials.rtpcooldown].expiration.formatted> <&c>to rtp again."
- stop
- flag player behr.essentials.rtpcooldown duration:5s
- define x <util.random.int[-<[distance]>].to[<[distance]>]>
- define z <util.random.int[-<[distance]>].to[<[distance]>]>
- chunkload <location[<[x]>,0,<[z]>,<player.world.name>].chunk> duration:1t
- define locationBlock <location[<[x]>,-1,[<[z]>]].material.name>
- while <[locationBlock]> == <[blocks]>:
- if <material.name.contains[blocks]>:
- define x <util.random.int[-<[distance]>].to[<[distance]>]>
- define z <util.random.int[-<[distance]>].to[<[distance]>]>
- chunkload <location[<[x]>,0,<[z]>,<player.world.name>].chunk> duration:1t
- announce "&cInvalid location, retrying."
- else:
- define loc <location[<[x]>,0,<[z]>,<player.world.name>]>
- narrate "<&a>Teleporting you randomly!"
- teleport <[loc].with_y[300].with_pitch[90]>