Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming items doesn't work #1505

Closed
ShaneBeee opened this issue Sep 3, 2018 · 16 comments
Closed

Naming items doesn't work #1505

ShaneBeee opened this issue Sep 3, 2018 · 16 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@ShaneBeee
Copy link
Contributor

ShaneBeee commented Sep 3, 2018

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.

@iOshawott
Copy link

yea, it's very uncomfortable >.<

@iOshawott
Copy link

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

@ShaneBeee ShaneBeee changed the title Item's can't have names Naming items doesn't work Sep 5, 2018
@bensku bensku added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. and removed completed The issue has been fully resolved and the change will be in the next Skript update. labels Sep 5, 2018
@bensku
Copy link
Member

bensku commented Sep 5, 2018

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.

@ShaneBeee
Copy link
Contributor Author

ShaneBeee commented Sep 5, 2018

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.

@Nicofisi
Copy link
Member

Nicofisi commented Sep 5, 2018

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

@Nicofisi Nicofisi added the priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). label Sep 5, 2018
@ShaneBeee
Copy link
Contributor Author

@Nicofisi You're welcome :)

@RiverThrough
Copy link

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

@GiraffeCubed
Copy link

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

@Nicofisi
Copy link
Member

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

@Nicofisi
Copy link
Member

Nicofisi commented Sep 23, 2018

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

@RiverThrough
Copy link

@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

@Nicofisi
Copy link
Member

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

@ShaneBeee
Copy link
Contributor Author

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:

@ShaneBeee
Copy link
Contributor Author

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:

@GiraffeCubed
Copy link

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

@TheBentoBox
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

7 participants