How to make a random item list

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

This is just a little example.
I haven't tested it but I think this works
Code:
command /randomitem:
    trigger:
        set {_items::*} to split "diamond,stone,iron pickaxe,bow" at ","
        send random element out of {_items::*}
 
  • Like
Reactions: zysw
Or
Code:
command /randomitem:
    trigger:
        set {_items::*} to "diamond" and "stone", "iron pickaxe", "bow"
        send random element out of {_items::*}
 
Or
Code:
command /randomitem:
    trigger:
        set {_items::*} to "diamond" and "stone", "iron pickaxe", "bow"
        send random element out of {_items::*}
Why would you reply with the exact same code just changed up how the variable is made
 
Because i can + if you want a random item out of all items, you would need to use skript-reflect.
 
For a long time i was inactive in skript for a few months. When i tried getting a random item from all items, there was no way and skbee's one was also "trash" / buggy and had items that wheren't items. That's why i said you need skript-reflect which you obv don't need because you could your own addon just for that in theroy.
 
For a long time i was inactive in skript for a few months. When i tried getting a random item from all items, there was no way and skbee's one was also "trash" / buggy and had items that wheren't items. That's why i said you need skript-reflect which you obv don't need because you could your own addon just for that in theroy.
would you consider items like a knowledge book a 'non-item'?
 
Like potted oak sapling. This is a block and it makes a error when you try to drop / give it as an item.