1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cool thing to help creating custom items easier.

Discussion in 'Skript' started by ryanrox333, Mar 16, 2022.

Thread Status:
Not open for further replies.
  1. ryanrox333

    ryanrox333 Member

    Joined:
    Jul 6, 2019
    Messages:
    17
    Likes Received:
    0
    Basically, it's just a function that allows you to input 4 things and will return an item based on that.

    The First Argument - Item (String)
    The first argument is where you put your item, this is in a string format and is converted into an item. This is used to make it easier to make a command from this function.

    The Second Argument - Name (String)
    The second argument is where you put the name of the item. This set the name of the item that you are making. The character "_" is used as a space incase if you are making a command from this function.

    The Third Argument - Lore (String)
    The third argument is the lore of the item. This can be as long as you want it to be. The character "_" is used as a space and the character "|" is used to create a new line.

    The Fourth Argument - Glow (Boolean)
    The final argument is if you want the item to glow or not. Setting it to true will cause the item to glow, and putting false will cause the opposite.

    Examples:
    upload_2022-3-16_18-1-27.png
    upload_2022-3-16_18-1-44.png

    Both were created using the function.


    Code:
    Code (Text):
    1. function createItem(i: string, n: string, lore: string, g: boolean) :: item:
    2.     replace all "_" with " " in {_i}
    3.     if {_g} is true:
    4.         set {_item} to glowing {_i} parsed as item
    5.     else:
    6.         set {_item} to {_i} parsed as item
    7.     replace all "_" with " " in {_n}
    8.     set name of {_item} to colored {_n}
    9.     set {_l} to colored {_lore}
    10.     replace all "_" with " " in {_l}
    11.     replace all "|" with "%nl%" in {_l}
    12.     set lore of {_item} to {_l}
    13.     return {_item}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...