Metadata not working?

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

MachisCZ

Member
Jan 26, 2017
23
1
3
28
Hello guys, i tried to update my "Torch bow" to newest Skript cuz now on version dev29 (mc 1.12) cant check lore of tool fo shooter. So i tried to use metadatas but now i cant check my seted metadata in projectile. Any idea how to fix it? Thanks. My code:
code_language.skript:
on projectile hit:
    if projectiles is an arrow:
        broadcast "&a%metadata value ""Special"" of shot projectile%"
        if meta data "Special" of projectile is "svetluska":
            if shooter's inventory contains arrow named "&eSvetelkujici sip" with lore "&6Sip potrebny do luku Svetluska":
                if shooter can build at location of projectile:
                    wait 3 ticks
                    delete event-projectile
                    if shooter's tool is not enchanted with infinity:
                        remove 1 arrow named "&eSvetelkujici sip" with lore "&6Sip potrebny do luku Svetluska" from shooter
                    if block at event-projectile is not air:
                        drop 1 arrow named "&eSvetelkujici sip" with lore "&6Sip potrebny do luku Svetluska" at event-projectile
                        stop
                    set {_loc} to location of projectile
                    set block at {_loc} to torch
                else:
                    send "[&e&lSvetluska&f] &cNemuzes strilet svetylka v chranenych regionech!" to shooter   
            else:
                message "[&e&lSvetluska&f] &6Nemas u sebe Svetelkujici sip! Nepokladam svetylka." to shooter
            
on shoot:
    if lore of tool of shooter contains "&6Uzitecna pomucka vsech kopacu!||&6Po dopadu se vystreleny sip zmeni na louci":
        set meta data "Special" of projectile to "svetluska"
        broadcast "&c%metadata value ""Special"" of projectile%"
        set {_particle} to projectile
        drawDot count 2, particle "redstone", RGB 255, 255, 0, center {_particle}, rainbowMode false, visibleRange 50, pulseDelay 0, keepFor 60 ticks
 
Didn't know this was possible LMAO no help here, well maybe...
Errors ( if any )
Skript version
Spigot version?
 
Nop errors: debug broadcast is <none> in projectile event. Skript version 2.2 dev29, server version paper 1.12.
 
Try changing shot projectile to just projectile

edit: i have a skript-mirror alternative for metadata but this probably isn't an addon issue
 
Already tried with no suscess :emoji_frowning:
[doublepost=1507158057,1507156304][/doublepost]@Pikachu hu and which altermative you have? I can try it.
 
Last edited:
Already tried with no suscess :emoji_frowning:
[doublepost=1507158057,1507156304][/doublepost]@Pikachu hu and which altermative you have? I can try it.
code_language.skript:
on script load:
  import "org.bukkit.metadata.FixedMetadataValue"
  import "org.bukkit.Bukkit"
function setMetadata(n: string, t: object, o: object):
  set {_args::*} to {_n} and new {FixedMetadataValue}({Bukkit}.getPluginManager().getPlugin("Skript") and {_o})
  if {_o} is not null ref:
    {_t}.setMetadata({_args::*});
  else:
    set {_args::*} to {_n} and {Bukkit}.getPluginManager().getPlugin("Skript")
    {_t}.removeMetadata({_args::*});
function getMetadata(n: string, t: object) :: object:
  return (first element out of ...{_t}.getMetadata({_n}).toArray()).value()
function deleteMetadata(n: string, t: object):
  setMetadata({_n}, {_t}, null ref)
 
broadcast "&a%metadata value ""Special"" of event-projectile%"
its event-projectile not shot projectile
 
Of course i tried event-projectile as well andstill got <none>
Oh, well thats odd, I tested this variant from your code and it works fine for me

code_language.skript:
on shoot:
    set meta data "Special" of projectile to "svetluska"

on projectile hit:
    if projectiles is an arrow:
        broadcast "&a%metadata value ""Special"" of event-projectile%"

I'm on 1.12.2, dev29
You do have Skellett installed right? I'm assuming you would get errors if you didn't but I just want to make sure, try the code I tested and see if you still get <none>
 
Ok i will test it tomorrow (i am at work for now) and yes i have Skellet instaled. Thank you guys.
[doublepost=1507582331,1507164991][/doublepost]Hello, sorry for late raply but i wasnt home some days. So i tested code u posted here and still i am getting <none>
upload_2017-10-9_22-52-10.png
 
Ok i will test it tomorrow (i am at work for now) and yes i have Skellet instaled. Thank you guys.
[doublepost=1507582331,1507164991][/doublepost]Hello, sorry for late raply but i wasnt home some days. So i tested code u posted here and still i am getting <none>
View attachment 1251
Okay, so the metadata is not being set, try a super basic code like this and let me know if you get <none>

code_language.skript:
command /metadatatest:
    trigger:
        set metadata value "Special" of world "%player's world%" to "svetluska"
        wait 1 seconds
        send "&a%metadata value ""Special"" of player's world%" to player
 
Okay, so the metadata is not being set, try a super basic code like this and let me know if you get <none>

code_language.skript:
command /metadatatest:
    trigger:
        set metadata value "Special" of world "%player's world%" to "svetluska"
        wait 1 seconds
        send "&a%metadata value ""Special"" of player's world%" to player

This can be Done with nbt data instead if you would like that.

requires skstuff

code_language.skript:
add "{Tags:[""special""]}" to nbt of projectile

set {_value} to tag "Tags" of nbt of projectile

if "%{_value}%" = "[""special""]":
 
Okay, so the metadata is not being set, try a super basic code like this and let me know if you get <none>

code_language.skript:
command /metadatatest:
    trigger:
        set metadata value "Special" of world "%player's world%" to "svetluska"
        wait 1 seconds
        send "&a%metadata value ""Special"" of player's world%" to player
Tried this code and get console error:
code_language.skript:
[11:35:05] [Server thread/INFO]: MachisCZ issued server command: /metadatatest
[11:35:05] [Server thread/INFO]: MachisCZ [e6446fe0-b8c2-336e-a3d8-44ba18e1d81a]: /metadatatest
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[11:35:05] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[11:35:05] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[11:35:05] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[11:35:05] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[11:35:05] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[11:35:05] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Stack trace:
[11:35:05] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: UnparsedLiterals must be converted before use
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.UnparsedLiteral.invalidAccessException(UnparsedLiteral.java:273)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.UnparsedLiteral.getSingle(UnparsedLiteral.java:303)
[11:35:05] [Server thread/ERROR]: #!#! at com.gmail.thelimeglass.Expressions.ExprMetadata.change(ExprMetadata.java:61)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.effects.EffChange.execute(EffChange.java:271)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:220)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:182)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands.handleCommand(Commands.java:268)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:163)
[11:35:05] [Server thread/ERROR]: #!#! at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35)
[11:35:05] [Server thread/ERROR]: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1416)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1229)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14)
[11:35:05] [Server thread/ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[11:35:05] [Server thread/ERROR]: #!#! at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:842)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:766)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:664)
[11:35:05] [Server thread/ERROR]: #!#! at java.lang.Thread.run(Thread.java:748)
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Version Information:
[11:35:05] [Server thread/ERROR]: #!#! Skript: 2.2-dev29
[11:35:05] [Server thread/ERROR]: #!#! Bukkit: 1.12-R0.1-SNAPSHOT
[11:35:05] [Server thread/ERROR]: #!#! Minecraft: 1.12
[11:35:05] [Server thread/ERROR]: #!#! Java: 1.8.0_144 (Java HotSpot(TM) 64-Bit Server VM 25.144-b01)
[11:35:05] [Server thread/ERROR]: #!#! OS: Linux amd64 4.4.0-78-generic
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Current node: null
[11:35:05] [Server thread/ERROR]: #!#! Current item: set [(skellett|fixed)] meta[ ]data [value] %string% (of|in|within) %object% to "svetluska"
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Thread: Server thread
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! End of Error.
[11:35:05] [Server thread/ERROR]: #!#!
[doublepost=1507669620,1507630541][/doublepost]
This can be Done with nbt data instead if you would like that.

requires skstuff

code_language.skript:
add "{Tags:[""special""]}" to nbt of projectile

set {_value} to tag "Tags" of nbt of projectile

if "%{_value}%" = "[""special""]":
Alos tried NBTs too and still getting <none>... itr really odd it looks like everything in projectile hit event not working
 
Tried this code and get console error:
code_language.skript:
[11:35:05] [Server thread/INFO]: MachisCZ issued server command: /metadatatest
[11:35:05] [Server thread/INFO]: MachisCZ [e6446fe0-b8c2-336e-a3d8-44ba18e1d81a]: /metadatatest
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[11:35:05] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[11:35:05] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[11:35:05] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[11:35:05] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[11:35:05] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[11:35:05] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Stack trace:
[11:35:05] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: UnparsedLiterals must be converted before use
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.UnparsedLiteral.invalidAccessException(UnparsedLiteral.java:273)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.UnparsedLiteral.getSingle(UnparsedLiteral.java:303)
[11:35:05] [Server thread/ERROR]: #!#! at com.gmail.thelimeglass.Expressions.ExprMetadata.change(ExprMetadata.java:61)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.effects.EffChange.execute(EffChange.java:271)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:220)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:182)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands.handleCommand(Commands.java:268)
[11:35:05] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:163)
[11:35:05] [Server thread/ERROR]: #!#! at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35)
[11:35:05] [Server thread/ERROR]: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514)
[11:35:05] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1416)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1229)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14)
[11:35:05] [Server thread/ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[11:35:05] [Server thread/ERROR]: #!#! at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:842)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:766)
[11:35:05] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:664)
[11:35:05] [Server thread/ERROR]: #!#! at java.lang.Thread.run(Thread.java:748)
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Version Information:
[11:35:05] [Server thread/ERROR]: #!#! Skript: 2.2-dev29
[11:35:05] [Server thread/ERROR]: #!#! Bukkit: 1.12-R0.1-SNAPSHOT
[11:35:05] [Server thread/ERROR]: #!#! Minecraft: 1.12
[11:35:05] [Server thread/ERROR]: #!#! Java: 1.8.0_144 (Java HotSpot(TM) 64-Bit Server VM 25.144-b01)
[11:35:05] [Server thread/ERROR]: #!#! OS: Linux amd64 4.4.0-78-generic
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Current node: null
[11:35:05] [Server thread/ERROR]: #!#! Current item: set [(skellett|fixed)] meta[ ]data [value] %string% (of|in|within) %object% to "svetluska"
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! Thread: Server thread
[11:35:05] [Server thread/ERROR]: #!#!
[11:35:05] [Server thread/ERROR]: #!#! End of Error.
[11:35:05] [Server thread/ERROR]: #!#!
[doublepost=1507669620,1507630541][/doublepost]
Alos tried NBTs too and still getting <none>... itr really odd it looks like everything in projectile hit event not working
It could be paperspigot, I don't know much about it but that seems to be the only difference in our setups, we have the same skript version and are both on 1.12
 
Status
Not open for further replies.