forked from BisUmTo/scarpet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocateplayer.sc
27 lines (26 loc) · 1.28 KB
/
locateplayer.sc
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
import('math','_euclidean');
__config() -> {
'stay_loaded' -> true,
'scope' -> 'global',
'commands' -> {
'<locatedplayer>' -> _(locatedplayer) ->(
executorname = player()~'command_name';
executorposition = player()~'pos';
executordimension = player()~'dimension';
playerposition = player(locatedplayer)~'pos';
posizione = floor(player(locatedplayer)~'x') + ' ' + floor(player(locatedplayer)~'y') + ' ' + floor(player(locatedplayer)~'z');
dimensione = player(locatedplayer)~'dimension';
distanza = floor(_euclidean(executorposition, playerposition));
if (executordimension == dimensione,
print(executorname, format('w The player ' + locatedplayer + ' is at ', 'l [' + posizione + ']', '^ Click to teleport', '!/execute in ' + dimensione + ' run tp ' + executorname + ' ' + locatedplayer, 'w (' + distanza + ' blocks away)')),
print(executorname, format('w The player ' + locatedplayer + ' is at ', 'l [' + posizione + ']', '^ Click to teleport', '!/execute in ' + dimensione + ' run tp ' + executorname + ' ' + locatedplayer, 'w (' + dimensione + ')'))
)
)
},
'arguments' -> {
'locatedplayer' -> {
'type' -> 'players',
'single' -> true,
}
}
}