Script Version (do not put latest): 2.5.1
Script Author: SkriptLang
Minecraft Version: 1.12.2
Full Code:
Errors on Reload:
There's no block in a command event (line 3).
Console Errors: (if applicable)
N/A
Other Useful Info:
I'm new to Skript.
Executing /test in command block. The documentation says that
"If the command sender is a command block, its location can be retrieved by using %block's location%."
Addons using (including versions):
N/A
Troubleshooting:
Changing syntax from "command sender" to "command executor", adding 5th line to check block's location, which comes back <none>.
Changing code to:
Yields "<none>" being sent to the player. I'm looking for the command block's location.
Have you tried searching the docs? Yes, see Other Useful Info.
Have you tried searching the Forums? Yes, I found this old post which seemed to have the same issue, but a fix was never mentioned.
What other methods have you tried to fix it?
See Troubleshooting
Thank you in advance to anyone who tries to help!
[doublepost=1604374831,1604359745][/doublepost]Thanks to the help of some kind samaritans on the Discord, I have found a working solution. The correct code for this situation is:
Thank you to Killerz1243, DelayedGaming, and TheRealUnderscore for their help on this one. The full code in working condition is:
I also had to install Skript-Reflect in order for this to work.
Script Author: SkriptLang
Minecraft Version: 1.12.2
Full Code:
Code:
command /test:
trigger:
loop all entities in radius 5 around block's location:
loop-entity is a player:
message "%block's location%" to loop-entity
Errors on Reload:
There's no block in a command event (line 3).
Console Errors: (if applicable)
N/A
Other Useful Info:
I'm new to Skript.
Executing /test in command block. The documentation says that
"If the command sender is a command block, its location can be retrieved by using %block's location%."
Addons using (including versions):
N/A
Troubleshooting:
Changing syntax from "command sender" to "command executor", adding 5th line to check block's location, which comes back <none>.
Changing code to:
Code:
command /test:
trigger:
loop all entities:
loop-entity is a player:
message "%command executor's location%" to loop-entity
Have you tried searching the docs? Yes, see Other Useful Info.
Have you tried searching the Forums? Yes, I found this old post which seemed to have the same issue, but a fix was never mentioned.
What other methods have you tried to fix it?
See Troubleshooting
Thank you in advance to anyone who tries to help!
[doublepost=1604374831,1604359745][/doublepost]Thanks to the help of some kind samaritans on the Discord, I have found a working solution. The correct code for this situation is:
Code:
command sender.getBlock().getLocation()
Code:
command /test:
trigger:
set {_location} to command sender.getBlock().getLocation()
loop all entities in radius 5 of {_location}:
loop-entity is a player:
message "%command sender.getBlock().getLocation()%" to loop-entity
I also had to install Skript-Reflect in order for this to work.
Last edited: