1. 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 comminuty!

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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Head - RightClick

Discussion in 'Skript' started by Digszin, Jan 26, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. Digszin

    Digszin Member

    Joined:
    Jan 26, 2017
    Messages:
    28
    Likes Received:
    0
    How i can execute an player command with custom head?
    Example:
    Code (Skript):
    1. On RightClick of head:
    2.      execute player command "test"
    Command Block Head: /give @p minecraft:skull 1 3 {display:{Name:"Backpack"},SkullOwner:{Id:27a68fa2-0e84-7c3c-cdc6-b141288a5810,Properties:{textures:[{Value:eyJ0aW1lc3RhbXAiOjE0Mzc3MDQ3NTA0OTAsInByb2ZpbGVJZCI6IjUwNzk4YjJhN2QxYjQxYTRiNmFlYzRiNWUwOWJjMTcxIiwicHJvZmlsZU5hbWUiOiJFbHN3ZXlyIiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2ViZGY4ZDUzYmRiOTMyYzIyM2M2MjdiYmI4YzFlMGM1ZTM1MWE2MTZjZDgwNTY5MjljNjZlNmRjZTQ0NDMzZGIifX19 }]}}}
     
  2. Best Answer:
    Post #2 by ShaneBee, Jan 26, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    You could use SkStuff and create an item with custom nbt:

    Code (Skript):
    1. set {_head} to player head with custom nbt "{display:{Name:""Backpack""},SkullOwner:{Id:27a68fa2-0e84-7c3c-cdc6-b141288a5810,Properties:{textures:[{Value:eyJ0aW1lc3RhbXAiOjE0Mzc3MDQ3NTA0OTAsInByb2ZpbGVJZCI6IjUwNzk4YjJhN2QxYjQxYTRiNmFlYzRiNWUwOWJjMTcxIiwicHJvZmlsZU5hbWUiOiJFbHN3ZXlyIiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2ViZGY4ZDUzYmRiOTMyYzIyM2M2MjdiYmI4YzFlMGM1ZTM1MWE2MTZjZDgwNTY5MjljNjZlNmRjZTQ0NDMzZGIifX19 }]}}}"
     
    • Friendly Friendly x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Error:
    Code (Skript):
    1. [18:20:46 ERROR]: null
    2. org.bukkit.command.CommandException: Unhandled exception executing command 'sk'
    3. in plugin Skript v2.2-Fixes-V8b
    4.         at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spi
    5. got.jar:git-Spigot-550ebac-7019900]
    6.         at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14
    7. 1) ~[spigot.jar:git-Spigot-550ebac-7019900]
    8.         at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServe
    9. r.java:646) ~[spigot.jar:git-Spigot-550ebac-7019900]
    10.         at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerCon
    11. nection.java:1115) [spigot.jar:git-Spigot-550ebac-7019900]
    12.         at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java
    13. :950) [spigot.jar:git-Spigot-550ebac-7019900]
    14.         at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java
    15. :26) [spigot.jar:git-Spigot-550ebac-7019900]
    16.         at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java
    17. :53) [spigot.jar:git-Spigot-550ebac-7019900]
    18.         at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spi
    19. got.jar:git-Spigot-550ebac-7019900]
    20.         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    21. ?:1.8.0_101]
    22.         at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
    23.         at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:6
    24. 96) [spigot.jar:git-Spigot-550ebac-7019900]
    25.         at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    26. 16) [spigot.jar:git-Spigot-550ebac-7019900]
    27.         at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    28. 34) [spigot.jar:git-Spigot-550ebac-7019900]
    29.         at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    30. :537) [spigot.jar:git-Spigot-550ebac-7019900]
    31.         at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    32. Caused by: java.lang.NoSuchMethodError: com.sk89q.worldguard.protection.flags.De
    33. faultFlag.fuzzyMatchFlag(Ljava/lang/String;)Lcom/sk89q/worldguard/protection/fla
    34. gs/Flag;
    35.         at me.TheBukor.SkStuff.SkStuff$4.parse(SkStuff.java:244) ~[?:?]
    36.         at me.TheBukor.SkStuff.SkStuff$4.parse(SkStuff.java:1) ~[?:?]
    37.         at ch.njol.skript.registrations.Classes.parseSimple(Classes.java:400) ~[
    38. ?:?]
    39.         at ch.njol.skript.registrations.Classes.parse(Classes.java:429) ~[?:?]
    40.         at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
    41. teral.java:97) ~[?:?]
    42.         at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
    43. teral.java:86) ~[?:?]
    44.         at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
    45. teral.java:1) ~[?:?]
    46.         at ch.njol.skript.effects.EffChange.init(EffChange.java:209) ~[?:?]
    47.         at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:248) ~[?:?]
    48.         at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:175) ~[?:?]
    49.         at ch.njol.skript.lang.Statement.parse(Statement.java:60) ~[?:?]
    50.         at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:650) ~[?:?]
    51.         at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:56) ~[?
    52. :?]
    53.         at ch.njol.skript.lang.Conditional.<init>(Conditional.java:46) ~[?:?]
    54.         at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:736) ~[?:?]
    55.         at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:510) ~[?:?]
    56.         at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:268) ~[?:?]
    57.  
    58.         at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:155) ~[?:?]
    59.  
    60.         at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spi
    61. got.jar:git-Spigot-550ebac-7019900]
    62.         ... 14 more
    63. >
    Code:
    Code (Skript):
    1. on skript load:
    2.       set {_head} to player head with custom nbt "{display:{Name:""Backpack""},SkullOwner:{Id:27a68fa2-0e84-7c3c-cdc6-b141288a5810,Properties:{textures:[{Value:eyJ0aW1lc3RhbXAiOjE0Mzc3MDQ3NTA0OTAsInByb2ZpbGVJZCI6IjUwNzk4YjJhN2QxYjQxYTRiNmFlYzRiNWUwOWJjMTcxIiwicHJvZmlsZU5hbWUiOiJFbHN3ZXlyIiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2ViZGY4ZDUzYmRiOTMyYzIyM2M2MjdiYmI4YzFlMGM1ZTM1MWE2MTZjZDgwNTY5MjljNjZlNmRjZTQ0NDMzZGIifX19 }]}}}"
    and i tried this but don't work
    Code (Skript):
    1. command /cabeça:
    2.     trigger:
    3.         set {BackPack.Branca} to player's tool
    4.         give {BackPack.Branca} to player
    5. on rightclick with Head:
    6.     if head is {BackPack.Branca}:
    7.         execute player command "backpack"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...