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

Filter issue with lored items in an inventory #3905

Closed
MovesLikeJaeger opened this issue Apr 18, 2021 · 3 comments
Closed

Filter issue with lored items in an inventory #3905

MovesLikeJaeger opened this issue Apr 18, 2021 · 3 comments
Labels
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. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@MovesLikeJaeger
Copy link

MovesLikeJaeger commented Apr 18, 2021

Description

Attempted to set a list to all items in an inventory that had a lore, however this list will always return empty when using a filter. Have attempted numerous times with different layouts, none of which have worked apart from looping.

Steps to Reproduce

With a couple of items with a lore in your inventory, do this:

on inventory close:
set {_a::*} to all items in player's inventory where [lore of input is set]
broadcast "%{_a::*}%"

This will always return an empty list, however when attempting the same code with named items

on inventory close:
set {_a::*} to all items in player's inventory where [name of input is set]
broadcast "%{_a::*}%"

It functions as it should and returns correctly

You can loop to work around this, but I thought it might be worth reporting incase it has other implications.

Expected Behavior

Should not be returning an empty list if your inventory has lored items inside it

Server Information

Skript 2.5.3
Paper 1.16.5

Extra comments

Funnily enough, this filter works for removing non lored items from the list, which I find quite interesting as it is very similar.

on inventory close:
set {_a::*} to all items in player's inventory
remove ({_a::*} where [lore of input is not set]) from {_a::*}
broadcast "%{_a::*}%"

Thanks for reading :)

@AyhamAl-Ali
Copy link
Member

AyhamAl-Ali commented Apr 23, 2021

Even weirder is that this code doesn't work

set {_a::*} to all items in player's inventory where [lore of input is set]
broadcast "%{_a::*}%" # <none> while there are 3 items in inventory that has lore

but this works

set {_a::*} to all items in player's inventory
broadcast "%{_a::*}  where [lore of input is set]%" # broadcasts the 3 items with lore

image

EDIT:
and this doesn't work either
broadcast "%all items in player's inventory where [lore of input is set]%" #

@FranKusmiruk FranKusmiruk added 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). labels Apr 23, 2021
@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Apr 27, 2021
@FranKusmiruk FranKusmiruk added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Apr 28, 2021
@MovesLikeJaeger
Copy link
Author

Apologies for another notification, but should this be closed now?

@TPGamesNL
Copy link
Member

Nope
We close issues when the fix has been published in a release

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. completed The issue has been fully resolved and the change will be in the next Skript update. 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

5 participants