Hello,
I'm trying to use some skripts in command blocks in 1.13.2 but nothing happened when I active these command blocks, no result at all.
I tested :
PS:
Can you help me ?
Thanking you in advance,
Killance
If I'm not mistaken, this isn't a Skript issue, this is a Spigot/MC issue.
Since 1.13 command selectors @p do not work in Spigot/Plugin commands, only Minecraft commands.
oh okay, thank you for your answer
@Killance did you try with simple commands like /test without arguments ?
Yes, a /test command without any arguments works fine
@Killance that's good thinking you got there - but think about this: do any other plugins use the target selectors like @p or @s etc? They don't - with a few exceptions. And those exceptions would've had to recreate those target selectors for themselves.
That's what you'd have to do aswell. The input arguments need to be handled within your custom commands. :)
You could do it like this however:
command /test <text>:
trigger:
arg 1 = "@p":
(command sender).getBlock() is set
set {_location} to (command sender).getBlock().getLocation()
loop all players:
loop player's world = {_location}'s world
if {_closest-player} is not set:
set {_closest-player} to loop-player
else if (distance between loop-player and {_location}) < (distance between {_closest-player} and {_location}):
set {_closest-player} to loop-player
{_closest-player} is set
send "&aYou're @p!" to {_closest-player}
Unfortunately this requires the usage of skript-mirror to work. Maybe a good opportunity to get/learn it, if you haven't already. :)
that's good thinking you got there - but think about this: do any other plugins use the target selectors like @p or @s etc? They don't - with a few exceptions. And those exceptions would've had to recreate those target selectors for themselves.
This isn't true. Bukkit offers a static selectEntities which can return entities from a target selector for you, found here. It's easy to use and implement into plugins; the only reason other plugins might not do it is because they haven't bothered.
Oh that's really cool - thanks for pointing that out!
I don't know how implementation of this would work or how doable it is. It might just be something simple we're missing but it's a larger consideration.
Definitely possible for 1.14+, but unfortunately the relevant code is not... exactly readable.