Skript: Naming items doesn't work

Created on 3 Sep 2018  路  16Comments  路  Source: SkriptLang/Skript

I noticed Bensku added 1.13 to the main branch so im going to post my findings.
(Skript version 2.3-alpha1)

It appears that skript isn't parsing aliases as items properly
example:

command /test:
    trigger:
        give player 1 of diamond sword named "TEST"

or

command /test:
    trigger:
        set {_test} to diamond sword
        set display name of {_test} to "TEST"
        give player 1 of {_test}

Both of these just give said player a diamond sword with its default name
But if I set {_test} to a diamond sword, as text parsed as an item:

command /test:
    trigger:
        set {_test} to "diamond sword" parsed as item
        set display name of {_test} to "TEST"
        give player 1 of {_test}

This will give the player a diamond sword with a name

Same goes for enchantments and lore.

bug medium

Most helpful comment

Can someone confirm that this works in vanilla Skript with no addons, please <3

@Nicofisi here is what I tested (no addons, fresh install of skript alpha 4)

command /test:
    trigger:
        give player 1 of diamond sword named "&aTEST"
        give player 1 of diamond sword named "&aTest" with lore "&bLore Test"

This gives me 1 diamond sword named TEST and also a diamond sword (unnamed) but the lore is correct "Lore Test"
First sword:

Second Sword:

All 16 comments

yea, it's very uncomfortable >.<

p.s.
unenchanted pickaxe is "diamond pickaxe" and "if player's tool is diamond pickaxe": works
enchanted pickaxe is "DIAMOND_PICKAXE" and "if player's tool is diamond pickaxe": doesn't works
"if player's tool is any pickaxe" also broken - doesn't work anyway

The parse issue appears to not be solved, though I'm not sure if it could also be an user error. Regardless, naming items will now work if the syntax is recognized.

Hey, So I see it said it was fixed. But it seems to have gotten worse ;)
If I do this

command /test:
    trigger:
        give player 1 of diamond sword named "TEST"

It now won't even give me an item.
if I remove the named part, it gives me a diamond sword. But with the name it gives me nothing.

Edit: as per my examples above, if I put the item name in quotes and parse it as an item, it will give me the named item.

@ShaneBeee yeah, @Pikachu920 has told bensku about that an hour ago, thanks for reporting here though 馃憤

@Nicofisi You're welcome :)

After 2.3-alpha4 you can name items but if you add lore same issue happens

After 2.3-alpha4 you can name items but if you add lore same issue happens

Can confirm, I can't spawn items with lore. Gist

https://gist.github.com/GiraffeCubed/37616618d652e8399643a2bc7eb2a373

This is due to the incompatibility of skQuery with the latest version of Skript. @GiraffeCubed if you use something from skQuery that's not available in other addons please make a feature request about it here in the Skript's issue tracker, or talk about this to some addon dev - skQuery has been abandoned, unsupported and not recommended to use by pretty much everyone for quite a while.

@TheLimeGlass to repeat, if you plan to keep developing your fork of skQuery, please delete the ExprLoredItemStack class altogether

@RiverThrough could you please exactly describe what happens to you and with what code

@RiverThrough could you please exactly describe what happens to you and with what code

Oops sorry, I had completely forgotten the "with lore" syntax was part of skquery and not vanilla skript, the issue is not for to report then my apologies

Can someone confirm that this works in vanilla Skript with no addons, please <3

Can someone confirm that this works in vanilla Skript with no addons, please <3

@Nicofisi here is what I tested (no addons, fresh install of skript alpha 4)

command /test:
    trigger:
        give player 1 of diamond sword named "&aTEST"
        give player 1 of diamond sword named "&aTest" with lore "&bLore Test"

This gives me 1 diamond sword named TEST and also a diamond sword (unnamed) but the lore is correct "Lore Test"
First sword:

Second Sword:

Another test

command /test:
    trigger:
        set {_sword} to diamond sword named "&aTest"
        set 1st line of lore of {_sword} to "&bLore Test"
        give player 1 of {_sword}

Outcome:

I ran in to the same problem with this. Named items work, and lored items work, but named + lored items lose their name.

I'm making #1620 the primary source of discussion for the issue of item name and lore expressions not working when used together since the problem that this issue was initially addressing (the named item expression not working) seems to be resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheClassic36 picture TheClassic36  路  3Comments

Snow-Pyon picture Snow-Pyon  路  4Comments

MrScopes picture MrScopes  路  3Comments

Eryk1983S picture Eryk1983S  路  3Comments

cyanide43 picture cyanide43  路  4Comments