Solved Head - RightClick

  • 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!

  • 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.

Digszin

Member
Jan 26, 2017
28
0
1
33
How i can execute an player command with custom head?
Example:
code_language.skript:
On RightClick of head:
     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 }]}}}
 
You could use SkStuff and create an item with custom nbt:

code_language.skript:
set {_head} to player head with custom nbt "{display:{Name:""Backpack""},SkullOwner:{Id:27a68fa2-0e84-7c3c-cdc6-b141288a5810,Properties:{textures:[{Value:eyJ0aW1lc3RhbXAiOjE0Mzc3MDQ3NTA0OTAsInByb2ZpbGVJZCI6IjUwNzk4YjJhN2QxYjQxYTRiNmFlYzRiNWUwOWJjMTcxIiwicHJvZmlsZU5hbWUiOiJFbHN3ZXlyIiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2ViZGY4ZDUzYmRiOTMyYzIyM2M2MjdiYmI4YzFlMGM1ZTM1MWE2MTZjZDgwNTY5MjljNjZlNmRjZTQ0NDMzZGIifX19 }]}}}"
 
You could use SkStuff and create an item with custom nbt:

code_language.skript:
set {_head} to player head with custom nbt "{display:{Name:""Backpack""},SkullOwner:{Id:27a68fa2-0e84-7c3c-cdc6-b141288a5810,Properties:{textures:[{Value:eyJ0aW1lc3RhbXAiOjE0Mzc3MDQ3NTA0OTAsInByb2ZpbGVJZCI6IjUwNzk4YjJhN2QxYjQxYTRiNmFlYzRiNWUwOWJjMTcxIiwicHJvZmlsZU5hbWUiOiJFbHN3ZXlyIiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2ViZGY4ZDUzYmRiOTMyYzIyM2M2MjdiYmI4YzFlMGM1ZTM1MWE2MTZjZDgwNTY5MjljNjZlNmRjZTQ0NDMzZGIifX19 }]}}}"
Error:
code_language.skript:
[18:20:46 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'sk'
in plugin Skript v2.2-Fixes-V8b
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spi
got.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14
1) ~[spigot.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServe
r.java:646) ~[spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerCon
nection.java:1115) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java
:950) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java
:26) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java
:53) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spi
got.jar:git-Spigot-550ebac-7019900]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
?:1.8.0_101]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
        at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:6
96) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
16) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
34) [spigot.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
:537) [spigot.jar:git-Spigot-550ebac-7019900]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
Caused by: java.lang.NoSuchMethodError: com.sk89q.worldguard.protection.flags.De
faultFlag.fuzzyMatchFlag(Ljava/lang/String;)Lcom/sk89q/worldguard/protection/fla
gs/Flag;
        at me.TheBukor.SkStuff.SkStuff$4.parse(SkStuff.java:244) ~[?:?]
        at me.TheBukor.SkStuff.SkStuff$4.parse(SkStuff.java:1) ~[?:?]
        at ch.njol.skript.registrations.Classes.parseSimple(Classes.java:400) ~[
?:?]
        at ch.njol.skript.registrations.Classes.parse(Classes.java:429) ~[?:?]
        at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
teral.java:97) ~[?:?]
        at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
teral.java:86) ~[?:?]
        at ch.njol.skript.lang.UnparsedLiteral.getConvertedExpression(UnparsedLi
teral.java:1) ~[?:?]
        at ch.njol.skript.effects.EffChange.init(EffChange.java:209) ~[?:?]
        at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:248) ~[?:?]
        at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:175) ~[?:?]
        at ch.njol.skript.lang.Statement.parse(Statement.java:60) ~[?:?]
        at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:650) ~[?:?]
        at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:56) ~[?
:?]
        at ch.njol.skript.lang.Conditional.<init>(Conditional.java:46) ~[?:?]
        at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:736) ~[?:?]
        at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:510) ~[?:?]
        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:268) ~[?:?]

        at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:155) ~[?:?]

        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spi
got.jar:git-Spigot-550ebac-7019900]
        ... 14 more
>
Code:
code_language.skript:
on skript load:
      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_language.skript:
command /cabeça:
    trigger:
        set {BackPack.Branca} to player's tool
        give {BackPack.Branca} to player
on rightclick with Head:
    if head is {BackPack.Branca}:
        execute player command "backpack"
 
Status
Not open for further replies.