Item alias as variable for sign

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

Omanoctoa

Member
Feb 4, 2025
16
1
3
Hello there!
I have a complicated problem involving Signs, which have a character limit of 16.
I'm putting item names on the signs (some which do not fit) so I've created aliases for some item names, such as blackbrck dbslab = polished_blackstone_brick_slab and this works fine for players to input onto signs. Skript can recognize the material based on the alias name (this part works!)

Now the problem: When skript tries to put the material name back ONTO THE SIGN, it replaces the alias name with the material's proper name (at least as much will fit). This is where I run into problems. How can I make Skript use the alias name instead of the material name?

Basic Skript and SkBee only.

Modified snippet from my code, original Skript is some 500 lines long...


Code:
on rightclick:
    event-block is signs #        alias for all sign types
    set {_sign} to event-block
    set {_matcheck} to 1st line of block at {_sign} parsed as item
    if {materials::*} contains {_matcheck}:
        set {signmat} to {_matcheck}
        set 1st line of block at {_sign} to "%{signmat}%"

When I set the sign material to something simple, like "stone" it works just fine. But when the name is longer than the sign, it fails to register it the second time. I have it setting the material to a variable, however this is not functional in this case because the material can change and the sign must read it dynamically. If the material is not set on the sign, it will automatically input the material detected.
 
Alternatively, is it possible to return the skript item alias after the proper item name is used? For instance, my example:
blackbrck dbslab = polished_blackstone_brick_slab
I can use "blackbrick dbslab" on a sign to make skript see polished blackstone brick slab[type=double], but if I don't put the alias on the sign and the skript finds the double-slab on it's own, how can I make it put the alias on the sign?

I need it to associate the alias with the vanilla item, but also the vanilla item with the alias (in reverse) is this possible?