Solved Display all Materials skript-reflect

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

MrNygus

Active Member
Jan 28, 2017
116
2
18
26
How can I display all Materials name?

Code:
import:
    java.util.Arrays
    org.bukkit.Material
   
command /lista:
    executable by: console
    trigger:
        set {_nl} to Arrays.stream(Material.values())
        send {_nl} to console
 
How can I display all Materials name?

Code:
import:
    java.util.Arrays
    org.bukkit.Material
  
command /lista:
    executable by: console
    trigger:
        set {_nl} to Arrays.stream(Material.values())
        send {_nl} to console
There is no need to use the Array in these cases. You could just use these methods:

Firstly.

code_language.skript:
import:
   org.bukkit.Material

command /lista:
   executable by: console
   trigger:
       send "%...Material.values()%" to console

Secondly.

code_language.skript:
import:
   org.bukkit.Material

command /lista:
   executable by: console
   trigger:
      loop ...Material.values():
         send "%loop-value%" to console

If you still wanna use Arrays, then do this:

code_language.skript:
import:
    org.bukkit.Material
    java.util.Arrays

command /lista:
    executable by: console
    trigger:
       #1
       send "%...Arrays.stream(Material.values())%" to console

       #2
       loop ...Arrays.stream(Material.values()):
           send "%loop-value%" to console
 
Status
Not open for further replies.