-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
to the surface.sk
38 lines (35 loc) · 1.61 KB
/
to the surface.sk
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
options:
cooldown: 10 minutes #formated as (Amount of time) (Seconds, Minutes, days ect...)
avoid: water or lava #Avoid spawning formated as (Block) or (Block) ect...
worlds: "world" #worlds formated as "(World name)" or "(World name)" or "(World name)" ect...
Permission: Surface.use #Permission
PermissionMessage: &cYou do not have permission to use this command! #No permission message
CommandIsNotExecuteableInWorld: &cYou can’t use this command in this world! #Can not execute command in this world message
CooldownMessage: &CYou have to wait another %{_cooldown}% &cbefore you can execute this command again! #Cooldown message %{_cooldown}% is the time until the command is executeable again)
BlockAvoidMessage: &cYou can't surface right now! #Called when the surface is a block to avoid message
Command Surface:
permission: {@Permission}
Permission Message: {@PermissionMessage}
trigger:
if world is not {@worlds}:
send "{@CommandIsNotExecuteableInWorld}"
else:
if difference between {Surface::%player%} and now is less than {@cooldown}:
set {_cooldown} to {@cooldown}
remove difference between {Surface::%player%} and now from {_cooldown}
send "{@CooldownMessage}"
else:
wait 1 tick
set {_loc} to location at player
set y-coordinate of {_loc} to 255
while block at {_loc} is air:
remove 1 from y-coordinate of {_loc}
loop all blocks in radius 1 of {_loc}:
if loop-block is not {@avoid}:
add 1 to y-coordinate of {_loc}
teleport player to {_loc}
set {Surface::%player%} to now
stop
else:
send "{@BlockAvoidMessage}"
stop