Displaying a item in chat

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

SkRATZ

Member
Nov 16, 2018
11
0
1
24
Basically wanted to display the player's held item in chat with a command or a message such as [item] or /item

Code:
on chat:
    cancel event
    set {_message} to message
    set {_item} to player's held item
    if player's held item is not air:
        if message contains "[item]":
            set {_lore} to nbt of player's held item
            if {_lore} contains "{}":
                set {_lore} to ""
            else:
                set {_lore} to "&4Lore: &c%{_lore}%"
            replace all "'" with "" in {_lore}
            replace all """" with "" in {_lore}
            set {_item} to capitalized "&c%{_item}%"

After this I'm completely stuck
 
code_language.skript:
replace all "[item]" with "%player' tool%" in message

Don't know if player' tool has to be in quotes and %
 
Status
Not open for further replies.