Maintain OR list instead of evaluating when using 'item named x or y'.
Skript/Server Version
ran on skript 2.10.0 and latest skript 2.11.2
Bug Description
I'm using the Inventory Click Event.
When using the Named Item/Inventory Expression it executes whenever it wants.
Expected Behavior
Should be executing every time.
Steps to Reproduce
command /t:
trigger:
give player dirt named "&7Dave"
on inventory click:
set {_item} to cursor slot of player
if all:
# this thing
{_item} = dirt named "&7Clay", "&7Dave", "&7JD", or "&7Junior"
event-slot != air
then:
cancel event
send "t"
Errors or Screenshots
No response
Other
No response
Agreement
- [x] I have read the guidelines above and affirm I am following them with this report.
What is the issue with this code?
it executes whenever it wants. Should be executing every time.
These are not exactly clear descriptions, when is it not being executed?
I think this has to do with you using 'or' in your condition. can you try comparing to 1 item name for testing? if that works can you also try ((dirt named "&7Clay"), (dirt named "&7Dave"), (dirt named "&7JD"), or (dirt named "&7Junior"))
What is the issue with this code?
it executes whenever it wants. Should be executing every time.
These are not exactly clear descriptions, when is it not being executed?
Using the code would be more helpful to demonstrate the problem. When you have an item equipped with the cursor and try to click another item. It should keep printing "t" every inventory click. Instead, it prints whenever it feels like it
I think this has to do with you using 'or' in your condition. can you try comparing to 1 item name for testing? if that works can you also try
((dirt named "&7Clay"), (dirt named "&7Dave"), (dirt named "&7JD"), or (dirt named "&7Junior"))
This is what's happening, it's working as intended. There's a possible enhancement here with similar syntaxes like world "x", "y", or "z", but the current way skript works requires you to do dirt named x, dirt named y, or dirt named z.
Please see the comment from eren, the parser is likely interpreting it as dirt named ("name1", "name2", "name3" or "name4"), picking a random name each time and checking against that, instead of all names.
I think this has to do with you using 'or' in your condition. can you try comparing to 1 item name for testing? if that works can you also try
((dirt named "&7Clay"), (dirt named "&7Dave"), (dirt named "&7JD"), or (dirt named "&7Junior"))
Checking individual names work and the snippet you provided works great.
Initially, i thought it was a way of just checking names with an item type
But this makes sense
So, it would probably be better to compare an item with an item type
Then compare the item's name with a list of strings