Executing Skript's custom commands as an entity

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

GreatKnightJ

New Member
Dec 20, 2017
5
0
0
If I make a custom command using skript, is there any way to run it as an entity using /execute?
I have the following command defined, and it works fine when a player runs it:

code_language.skript:
command /SkTest:
    description: A thing
    trigger:
        set {x.%player%} to the player's x-coordinate
        set {y.%player%} to the player's y-coordinate
        set {z.%player%} to the player's z-coordinate
        make player execute "/mm mobs spawn AHorse 1 world,%{x.%player%}%,%{y.%player%}%,%{z.%player%}%"

and when I try to use /execute @e[type=Zombie,c=1] ~ ~ ~ /sktest, it returns the message "all invocations failed: /sktest". Is there any way around this, and if so, how do I format my command to work when executed as an entity?
(p.s: the /mm command comes from MythicMobs. The command format is correct, as proven by the fact that players can run it correctly)
 
I could see him maybe doing it for boss fights or npc's to spawn minions maybe? You could just spawn them at the location though..
I'm making a plugin using skript, mythic mobs, and others. Players basically have to be able to set down structures that can spawn mythic mobs, but the command to spawn mythic mobs likes to have co-ordinates when used by an entity, and it doesn't accept tildes. Hence, I'm using a skript to insert the co ordinates into the command before it runs
 
Status
Not open for further replies.