set item to id or english name?

  • 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.
set {_item} to 272 parsed as item
Sorry...
command /test:
trigger:
set {_x} to 272
set {_test} to {_x} parsed as item
broadcast "%id of {_test}%"
But it do not work.It sended "<none>".
My minecraft version is 1.12.1.
Sk version is the lastest.
 
Why do you need ids? They are being removed in 1.13
English name is also ok.
command /test:
trigger:
set {_x} to "stone_sword"
set {_test} to {_x} parsed as item
broadcast "%id of {_test}%"
But it do not work,either.
 
English name is also ok.
command /test:
trigger:
set {_x} to "stone_sword"
set {_test} to {_x} parsed as item
broadcast "%id of {_test}%"
But it do not work,either.
Thats because skript doesn't allow you to get the id of something that doesnt have a slot attached
 
It's just how Skript works. You could work around it with skript-mirror though.

Here is a custom expression for it:

code_language.skript:
#put this on a folder within the scripts folder or a script named "!syntaxes.sk"
get items property type id[s]:

  loop expressions-1:
    add loop-value.getRandom().getTypeId() to {_output::*}
  continue {_output::*}

#Example usage
set {_test} to stone
send "%type id of {_test}%"
 
Status
Not open for further replies.