Skript: Named expression returns an inventory when used with variables

Created on 5 Mar 2018  路  24Comments  路  Source: SkriptLang/Skript

console is full of errors like(they didn't appear in previous version):

[09:33:12] [Server thread/ERROR]: [Skript] '::blocks::146} named "&fDouble Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."' is not a valid item data (plotmenu.sk, line 387: player does not have {heads::blocks::146} named "&fDouble Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."')
[09:33:12] [Server thread/ERROR]: [Skript] '::blocks::146} named "&fDouble Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."' is not a valid item data (plotmenu.sk, line 388: give {heads::blocks::146} named "&fDouble Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture." to player')
[09:33:12] [Server thread/ERROR]: [Skript] '::blocks::145} named "&fDouble Red Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."' is not a valid item data (plotmenu.sk, line 393: player does not have {heads::blocks::145} named "&fDouble Red Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."')
[09:33:12] [Server thread/ERROR]: [Skript] '::blocks::145} named "&fDouble Red Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."' is not a valid item data (plotmenu.sk, line 394: give {heads::blocks::145} named "&fDouble Red Sandstone Slab(All sides)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture." to player')
[09:33:13] [Server thread/ERROR]: [Skript] '::mobs::101} named "&fEnder Crystal" with lore "&7You can place ender crystals!"' is not a valid item data (plotmenu.sk, line 426: set slot 3 of player's current inventory to {heads::mobs::101} named "&fEnder Crystal" with lore "&7You can place ender crystals!"')
[09:33:13] [Server thread/ERROR]: [Skript] '::blocks::130} named "&fRedstone Lamp (ON)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."' is not a valid item data (plotmenu.sk, line 428: set slot 5 of player's current inventory to {heads::blocks::130} named "&fRedstone Lamp (ON)" with lore "&cThis block places as a full block||&cHead is only used for inventory||&ctexture."')

so looks like it's something to-do with setting heads saved in variables.
I also noticed this happening with other blocks than heads, so might be not only head related

bug medium

All 24 comments

the with lore expression isn't from Skript, could you possibly try without it? Just to confirm it's a Skript issue.

looks like it's addon problem, but it worked in previous version, so that's unnice :(

Doesn't give an error for me with PaperSpigot 1.12.2-R0.1-SNP, Skript 2.2-dev34 and SkQuery 3.6.0 using the same code. You may have break something by mistake 馃槣

I'm closing this since it isn't a Skript issue and I can't reproduce it either. Open it again if it happens to be a Skript issue in the end.

here's the problem:
set slot 0 of player's inventory to {item} named "test" = can't understand
set slot 0 of player's inventory to iron ingot named "test" = can understand

variable is the problem, it works if not adding named or with lore.
you maybe tried to re-produce it wrongly

How do you set the {item}

set {item} to player's slot 0

giving/setting the item fully works without adding any "named" things, while it worked fully with named things with variable item in previous version(dev33)

Can reproduce 鉁旓笍 Here are the details; it throws the following stacktrace if the variable is set: https://gist.github.com/Blueyescat/deee44d31a874b263241df8a99e90416

The inventory support for Named expression causes the problem, it also doesn't give the error if the variable is set to an inventory.

@Snow-Pyon You did that feature, any idea why/if it might break addons?

Looks like it's returning an inventory even when it should return an item, probably fixed for the next patch. Sorry for the inconveniences.

I just got a similar issue with unrelated reasons compared to this https://github.com/bensku/Skript/issues/1163

Similar issues #1145 #1138

I now use the code '{test} parsed as itemtype'.
But this is not the best. Is there any way to solve it?

nope, just use that until it is fixed in skript.

details:
image

Please fix this asap, because it's hard to change all scripts only to change them again later when it is fixed. Also in some cases there is no workaround. Specially when you format a gui slot with an item from a variable.

'{test} parsed as itemtype'.
does not work for me

All guis with custom heads are broken even with the temporary workaround (parsed as item).

@bloggy you just have to change the return type, so, you can use:

formt gui slot 0 with (random item out of {_variable}) named "whatever"

And it won't be null this way.

Does not work for me. Enchanted items in guis are broken (not showing up).

take any enchanted item in your hand and try this:

command /mygui:
    trigger:
        set {_test} to "%player's tool%"
        wait 10 ticks
        skellett open "CHEST" with 4 rows named "&6SETUP" to player
        make a gui slot 1 of player with {_test} parsed as item with name "Test" with lore "Test" to do nothing

Result: empty inventory / slot

set {_test} to player's tool
make gui slot 1 of player with (random item out of {_test}) named "test"

Fixed (https://github.com/SkriptLang/Skript/commit/168f54498d05cc4611aceede15ed11394900cb97)

How can I use the fixed version? Where to download?

You can't yet unless you compile it. You could look at the nightly builds repo and see if it ia there too.

Opened again since we close issues after a release with the fix is out.

@Snow-Pyon Can be closed now.

Thanks @Blueyescat !

Was this page helpful?
0 / 5 - 0 ratings